1
0
Fork 0

Problem 65

This commit is contained in:
Jonathan Chan 2017-06-04 23:43:02 -07:00
parent facd95edfd
commit 2a8a035b72
4 changed files with 10 additions and 0 deletions

BIN
65 Executable file

Binary file not shown.

BIN
65.hi Normal file

Binary file not shown.

10
65.hs Normal file
View File

@ -0,0 +1,10 @@
seqOfE = (foldr (++) [] (map (\n -> [1, n, 1]) [64, 62..2])) ++ [2]
next n (a, b) = (b + n * a, a)
convergent tup seq = case seq of [] -> tup
(n:ns) -> convergent (next n tup) ns
sumOfNumeratorDigits (n, _) = foldr (\c acc -> acc + read [c] :: Integer) 0 (show n)
main = print $ sumOfNumeratorDigits (convergent (68, 67) seqOfE)

BIN
65.o Normal file

Binary file not shown.