OFFSET
1,2
COMMENTS
Record values: 1, 3, 8, 20, 24, 60, 100, 120, 300, 336, 500, 600, 624, 648, 1500, 1680, 1704, 1740, 2500, 3000, ...
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000 (n = 1..1547 from Richard N. Smith)
PROG
(PARI) 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)
a(n)=if(n==1, return(1)); my(k=entry(n)); forstep(i=k, n^2, k, if(fibmod(i-1, n)==1, return(i)))
print1(r=1); for(n=2, 1000, if(a(n)>r, r=a(n); print1(", "n))) \\ after Charles R Greathouse IV in A001175
CROSSREFS
KEYWORD
nonn
AUTHOR
Richard N. Smith, Jul 14 2019
STATUS
approved