Question 16
parent
b0e3c4a87d
commit
9cc718e6b2
|
@ -0,0 +1,15 @@
|
||||||
|
{-
|
||||||
|
https://projecteuler.net/problem=16
|
||||||
|
|
||||||
|
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
|
||||||
|
|
||||||
|
What is the sum of the digits of the number 2^1000?
|
||||||
|
-}
|
||||||
|
|
||||||
|
module Main where
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = print ans
|
||||||
|
|
||||||
|
ans :: Integer
|
||||||
|
ans = sum $ map (\c -> read [c] :: Integer) $ show (2^1000)
|
Loading…
Reference in New Issue