Problem 138

http://projecteuler.net/index.php?section=problems&id=138

x^2-5y^2=-1のペル方程式に帰着。

next (x,y) = (9*x+20*y,4*x+9*y)
p138 = map snd.iterate next $ (38,17)
main = print.sum.take 12$ p138
More Reading
Newer// Problem 137
Older// Problem 131