m@main=readLn>>=print.(!!1).f>>m a%b=[mod(a!!i*b!!j+a!!(i+1)*b!!(j+2))(10^9)|i<-[0,2],j<-[0,1]] f 0=[1,1,1,0] f x|odd x=z%z where z=f(x`div`2) f x=f(x-1)%f 0

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page