cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A039726 Recursive prime generating sequence.

This page as a plain text file.
%I A039726 #22 Jul 31 2017 05:56:36
%S A039726 2,3,5,7,11,19,29,37,47,67,103,179,191,223,271,293,317,577,643,673,
%T A039726 809,863,877,1049,1093,1129,1151,1381,1613,1637,2089,2131,2311,2957,
%U A039726 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 A039726 Recursive prime generating sequence.
%D A039726 H. Dubner, Recursive Prime Generating Sequences, Journal of Recreational Mathematics, 29(3) 170-175 1998 Baywood NY.
%H A039726 Robert G. Wilson v, <a href="/A039726/b039726.txt">Table of n, a(n) for n = 1..350</a>
%F A039726 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 A039726 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 A039726 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 A039726 For the primes so generated see A087864.
%Y A039726 Cf. A083771.
%K A039726 nonn
%O A039726 1,1
%A A039726 Harvey Dubner (harvey(AT)dubner.com)
%E A039726 Corrected and extended by _Ray Chandler_, Nov 06 2003
%E A039726 Further terms from _Lei Zhou_, Dec 08 2005