login
A130166
a(1)=1; a(n)=prime(mod(a(n-1),1000)).
0
1, 2, 3, 5, 11, 31, 127, 709, 5381, 2621, 4591, 4327, 2179, 1063, 307, 2027, 103, 563, 4091, 467, 3319, 2113, 617, 4549, 3967, 7607, 4463, 3299, 1979, 7717, 5431, 3001, 2, 3, 5, 11, 31, 127, 709, 5381, 2621, 4591, 4327, 2179, 1063, 307, 2027, 103, 563, 4091
OFFSET
1,2
COMMENTS
Starting with the second term, cycles every 31 terms.
Not the same sequence as a(1)=1; a(n)=mod(prime(a(n-1)),1000).
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1).
FORMULA
a(1)=1; a(n)=prime(mod(a(n-1),1000)).
MATHEMATICA
f[s_List] := Block[{}, Append[s, Mod[ Prime@ Last@ s, 1000]]]; Nest[f, {2}, 50]
NestList[Prime[Mod[#, 1000]]&, 1, 50] (* Harvey P. Dale, Jun 01 2012 *)
PROG
(PARI) A=vector(1000); A[1]=1; for(n=2, #A, A[n]=prime(A[n-1]%1000)); A \\ Charles R Greathouse IV, Jan 28 2025
(PARI) a(n)=if(n<4, return(n)); if(n>32, n=n%31; if(n<2, return(5431-2430*n))); my(k=2); for(i=3, n, k=prime(k%1000)); k \\ Charles R Greathouse IV, Jan 28 2025
CROSSREFS
Sequence in context: A090709 A357220 A112279 * A007097 A173422 A375554
KEYWORD
nonn,less,easy
AUTHOR
Robert G. Wilson v, May 13 2007
EXTENSIONS
NAME adapted to offset. - R. J. Mathar, Jun 20 2021
STATUS
approved