Multiples of 3 or 5 If we list all natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all multiples of 3 or 5 below 1000. R Code multiplos <- function(numMax){ num <- seq_len(numMax-1) test <- apply(rbind(num %% 3, num %% 5), 2, min) return(sum(num[test == 0])) } multiplos(10) > 23 multiplos(1000) > 233168 multiplos <- function(numMax, mult){ num <- seq_len(numMax-1) vecMult <- lapply(mult , function(div) num %% div) matMult <- do.call(rbind, vecMult) test <- apply(matMult, 2, min) return(sum(num[test == 0])) } multiplos(10, c(3,5)) > 23 multiplos(1000, c(3,5)) > 233168 Even Fibonacci numbers Each new term in the Fibonacci sequence is generated by adding the two previous terms. Starting with 1 and 2, the first 10. The terms will be: $$1,2,3,5,8,13, 21, 34, 55, 89, \dots$$ When considering terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even terms.