
I have the following Haskell code to generate the even values of the Fibonacci sequence as an infinite list:
z=zipWith(+)
g=z((*2)<$>0:0:g)$z(0:g)$(*2)<$>scanl(+)1g
This works by starting with 0,2 and then defining every following term to be the sum of:
twice all prior terms
the previous term
t...