euler/haskell/euler006.hs

9 lines
181 B
Haskell
Raw Normal View History

2020-10-28 08:23:29 +00:00
module Main where
sum_of_squares n = sum $ map (\m -> m * m) [1..n]
square_of_sum n = (\m -> m * m) (sum [1..n])
main = do
print $ (square_of_sum 100) - (sum_of_squares 100)