challenges/e1/e1.hs

7 lines
182 B
Haskell
Raw Normal View History

divisors_3_5 [] acc = acc
divisors_3_5 (x:xs) acc
| rem x 3 == 0 || rem x 5 == 0 = divisors_3_5 xs (x:acc)
| otherwise = divisors_3_5 xs acc
e1 = sum (divisors_3_5 [1 .. 999] [])