OFFSET
1,2
COMMENTS
Pisano-style numbers for the recurrence b(n) = n for 0 <= n <= 2, otherwise b(n) = b(n-1)*b(n-2) - b(n-3); that is, the sequence b(n) = A022405(n+1).
LINKS
Eric Weisstein's World of Mathematics, Pisano period.
Wikipedia, Pisano period.
PROG
(bc) /* GNU bc */ define p(m){auto os, a, b, c, d, k; if(m<3)return 2*m-1; os=scale; scale=0; a=0; b=1; c=2; k=0; while(1){d=(c*b+m-a)%m; a=b; b=c; c=d; k+=1; if(a==0&&b==1&&c==2)break}; scale=os; return k}; for(i=1; i<=200; i++)print p(i), ", "; print"\n"
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Carl R. White, Oct 05 2009
STATUS
approved