OFFSET
0,1
LINKS
Robert Israel, Table of n, a(n) for n = 0..10000
EXAMPLE
3+5+1=9 is not a prime.
3+7+1=11 is a prime: 7 is in the sequence.
7+11+1=19 is a prime: 11 is in the sequence.
11+13+1=25 is not a prime.
11+17+1=29 is a prime: 17 is in the sequence.
MAPLE
P:=proc(n) local i, w; w:=3; for i from 3 by 1 to n do if isprime(w+ithprime(i)+1) then print(ithprime(i)); w:=ithprime(i); fi; od; end: P(500);
MATHEMATICA
f[n_]:=Module[{p=NextPrime[n]}, While[!PrimeQ[n+p+1], p=NextPrime[p]]; p]; Join[{p=3}, Table[p=f[p], {n, 60}]] (* Vladimir Joseph Stephan Orlovsky, Feb 07 2012 *)
nxt[p_]:=Module[{np=NextPrime[p]}, While[!PrimeQ[p+np+1], np=NextPrime[np]]; np]; NestList[nxt, 3, 60] (* Harvey P. Dale, Jun 05 2023 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Jan 02 2006
EXTENSIONS
More terms from Paolo P. Lava and Giorgio Balzarotti, Mar 07 2007
Edited by N. J. A. Sloane at the suggestion of Stefan Steinerberger, Jun 07 2007
STATUS
approved