Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 483d82c85c
Fetching contributors…

Cannot retrieve contributors at this time

9 lines (7 sloc) 0.247 kb
squareOfSum :: Int -> Int
squareOfSum n = (sumFirstNums n) ^ 2
where sumFirstNums n = quot (n * (n + 1)) 2
sumOfSquares :: Int -> Int
sumOfSquares n = quot (n * (n+1) * (2*n + 1)) 6
euler6 :: Int -> Int
euler6 n = squareOfSum n - sumOfSquares n
Jump to Line
Something went wrong with that request. Please try again.