%I #22 Jul 31 2017 05:56:36
%S 2,3,5,7,11,19,29,37,47,67,103,179,191,223,271,293,317,577,643,673,
%T 809,863,877,1049,1093,1129,1151,1381,1613,1637,2089,2131,2311,2957,
%U 3623,3833,4253,4271,4423,4673,5939,7717,8167,9133,9533,9539,9679,11059,11743,11969,14759,15859,15971,16139,17431,17713,17761,19309,19373,20747,20983,23741,25261,25933
%N Recursive prime generating sequence.
%D H. Dubner, Recursive Prime Generating Sequences, Journal of Recreational Mathematics, 29(3) 170-175 1998 Baywood NY.
%H Robert G. Wilson v, <a href="/A039726/b039726.txt">Table of n, a(n) for n = 1..350</a>
%F 2*3*5*7*...*a(n) +1 is prime. a(n) is prime. a(n) > a(n-1) with a(n) being the smallest possible prime.
%t k = 1; cp = 2; ct = 1; n[ct] = 2; While[ct < 64, k++; p = Prime[k]; cp1 = cp*p; If[PrimeQ[cp1 + 1], cp = cp1; ct++; n[ct] = p]]; Table[n[k], {k, 1, ct}] (Lei Zhou)
%t f[s_List] := Block[{p = Times @@ s, q = NextPrime@ s[[-1]]}, While[ !PrimeQ[p*q + 1], q = NextPrime@ q]; Append[s, q]]; Nest[f, {2}, 63] (* _Robert G. Wilson v_, Jul 20 2017 *)
%Y For the primes so generated see A087864.
%Y Cf. A083771.
%K nonn
%O 1,1
%A Harvey Dubner (harvey(AT)dubner.com)
%E Corrected and extended by _Ray Chandler_, Nov 06 2003
%E Further terms from _Lei Zhou_, Dec 08 2005
|