Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 483d82c85c
Fetching contributors…

Cannot retrieve contributors at this time

9 lines (8 sloc) 0.291 kb
findMultiple :: Int -> Int -> Int
findMultiple currentProd next =
if mod currentProd next == 0
then currentProd
else currentProd * firstPrimeDivisor next
where firstPrimeDivisor n = head [ d | d <- [2..n], mod n d == 0 ]
euler5 :: Int -> Int
euler5 n = foldl findMultiple 1 [1..n]
Jump to Line
Something went wrong with that request. Please try again.