%I #19 Jun 05 2023 13:34:43
%S 3,7,11,17,19,23,29,31,41,47,53,59,67,71,79,83,89,101,109,113,127,149,
%T 157,173,179,193,227,229,233,257,263,277,293,307,311,331,359,367,383,
%U 389,397,431,449,457,461,467,479,487,503,509,521,541,587,593,599,601
%N Starting from P0=3, the sequence list the minimum prime P1>P0 for which the expression P=P1+P0+1 is also a prime. The search then restarts from P1.
%H Robert Israel, <a href="/A112786/b112786.txt">Table of n, a(n) for n = 0..10000</a>
%e 3+5+1=9 is not a prime.
%e 3+7+1=11 is a prime: 7 is in the sequence.
%e 7+11+1=19 is a prime: 11 is in the sequence.
%e 11+13+1=25 is not a prime.
%e 11+17+1=29 is a prime: 17 is in the sequence.
%p 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);
%t 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 *)
%t 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 *)
%Y Cf. A000040
%K easy,nonn
%O 0,1
%A _Amarnath Murthy_, Jan 02 2006
%E More terms from _Paolo P. Lava_ and _Giorgio Balzarotti_, Mar 07 2007
%E Edited by _N. J. A. Sloane_ at the suggestion of _Stefan Steinerberger_, Jun 07 2007