[go: up one dir, main page]

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”).

A248370
a(n+1) is the smallest prime beyond a(n) such that a(n+1) modulo a(n) is (congruent to) a prime; start with a(0)=1.
0
1, 3, 5, 7, 17, 19, 41, 43, 89, 181, 367, 739, 1481, 1483, 2969, 2971, 5953, 11909, 23831, 23833, 47713, 95429, 190871, 381749, 763559, 1527121, 3054283, 6108607, 12217327, 24434701, 48869413, 97738843, 195477691, 390955399, 781910809, 1563821621, 3127643381, 3127643383, 6255286777
OFFSET
0,2
COMMENTS
The same terms > 3 would be obtained when starting with a(1)=2.
Shevelev cites El Bachraoui, Lemoine-Levy's conjecture and A046927, cf. links.
FORMULA
If a(n)+2 is prime, then a(n+1) = a(n)+2, else a(n+1) > 2*a(n), since a(n)+p is even for primes a(n), p > 2.
MATHEMATICA
sp[n_]:=Module[{p=NextPrime[n]}, While[!PrimeQ[Mod[p, n]], p=NextPrime[p]]; p]; Join[{1}, NestList[sp, 3, 20]] (* The program generates the first 21 terms of the sequence. To generate more, increase the constant "20" in the NestList function, but the program may take a long time to run. *) (* Harvey P. Dale, Jan 13 2019 *)
PROG
(PARI) {print1(L=3); for(p=L+1, 9e9, p=nextprime(p); isprime(p%L)&&print1(", "L=p)+(isprime(p+2)||p*=2))}
CROSSREFS
Cf. A046927.
Sequence in context: A171254 A092951 A001259 * A087126 A348438 A331800
KEYWORD
nonn
AUTHOR
Eric Angelini and M. F. Hasler, Oct 05 2014
STATUS
approved