while 1: a=m=10**9;b=1 for c in bin(input()): \x09a,b=a*a+b*b,b*(2*a+b)%m \x09if'1'!=c:a=b-a%m;b-=a print b
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page