login
A237836
Pisano period of n^2.
1
1, 6, 24, 24, 100, 24, 112, 96, 216, 300, 110, 24, 364, 336, 600, 384, 612, 216, 342, 600, 336, 330, 1104, 96, 2500, 1092, 1944, 336, 406, 600, 930, 1536, 1320, 612, 2800, 216, 2812, 342, 2184, 2400, 1640, 336, 3784, 1320, 5400, 1104, 1504, 384, 5488, 7500
OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = A001175(n^2).
PROG
(PARI) fibmod(n, m)=((Mod([1, 1; 1, 0], m))^n)[1, 2]
entry_p(p)=my(k=1, c=Mod(1, p), o); while(c, [o, c]=[c, c+o]; k++); k
entry(n)=if(n==1, return(1)); my(f=factor(n), v); v=vector(#f~, i, if(f[i, 1]>1e14, entry_p(f[i, 1]^f[i, 2]), entry_p(f[i, 1])*f[i, 1]^(f[i, 2] - 1))); if(f[1, 1]==2&&f[1, 2]>1, v[1]=3<<max(f[1, 2]-2, 1)); lcm(v)
per(n)=if(n==1, return(1)); my(k=entry(n)); forstep(i=k, n^2, k, if(fibmod(i-1, n)==1, return(i)))
a(n)=per(n^2)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved