login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A355598
a(1) = 3. For n > 1, a(n) = smallest prime q such that q^(a(n-1)-1) == 1 (mod a(n-1)^2).
5
3, 17, 131, 659, 503, 9833, 49603, 327317, 13900147, 144229223, 5872276013
OFFSET
1,1
COMMENTS
Is this overall an increasing sequence or does it enter a cycle?
The sequence decreases for the first time at n = 5.
MATHEMATICA
sp[n_]:=Module[{p=2}, While[PowerMod[p, n-1, n^2]!=1, p=NextPrime[p]]; p]; NestList[sp, 3, 8] (* Harvey P. Dale, Jul 23 2023 *)
PROG
(PARI) seq(start, terms) = my(x=start, i=1); print1(start, ", "); while(1, forprime(q=1, , if(Mod(q, x^2)^(x-1)==1, print1(q, ", "); x=q; i++; if(i >= terms, break({2}), break))))
seq(3, 20) \\ Print initial 20 terms of sequence
CROSSREFS
Row n = 2 of A249162.
Sequence in context: A089815 A328402 A247788 * A006759 A073513 A074524
KEYWORD
nonn,hard,more
AUTHOR
Felix Fröhlich, Jul 09 2022
STATUS
approved