login
A343116
a(n) is the Pisano period of prime(n)^2.
1
6, 24, 100, 112, 110, 364, 612, 342, 1104, 406, 930, 2812, 1640, 3784, 1504, 5724, 3422, 3660, 9112, 4970, 10804, 6162, 13944, 3916, 19012, 5050, 21424, 7704, 11772, 8588, 32512, 17030, 37812, 6394, 22052, 7550, 49612, 53464, 56112, 60204, 31862, 16290, 36290
OFFSET
1,1
FORMULA
a(n) = A001175(A001248(n)).
PROG
(PARI) \\ After Charles R Greathouse IV in A001175 (Start)
fibmod(n, m)=((Mod([1, 1; 1, 0], m))^n)[1, 2]
entryp(p)=my(k=p+[0, -1, 1, 1, -1][p%5+1], f=factor(k)); for(i=1, #f[, 1], for(j=1, f[i, 2], if((Mod([1, 1; 1, 0], p)^(k/f[i, 1]))[1, 2], break); k/=f[i, 1])); k
entry(n)=if(n==1, return(1)); my(f=factor(n), v); v=vector(#f~, i, if(f[i, 1]>1e14, entryp(f[i, 1]^f[i, 2]), entryp(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)
a001175(n)=if(n==1, return(1)); my(k=entry(n)); forstep(i=k, n^2, k, if(fibmod(i-1, n)==1, return(i)))
\\ (End)
a(n) = my(p=prime(n)); a001175(p^2)
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Apr 05 2021
STATUS
approved