#!perl -pl use bigint;@@=(1,0,1),@m=(1,1,0);sub W{map{(@m[$_/6]*@_[$_/5]+@m[$_/3]*@_[$_/5+1])%1e9}4..6}for($_++;$_;$_/=2){@@=W@@if$_&1;@m=W@m}$_=@@[1]
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page