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.

A005234 Primes p such that 1 + product of primes up to p is prime.

This page as a plain text file.
%I A005234 M0669 #127 Aug 21 2025 08:48:14
%S A005234 2,3,5,7,11,31,379,1019,1021,2657,3229,4547,4787,11549,13649,18523,
%T A005234 23801,24029,42209,145823,366439,392113,4328927,5256037,6369619,
%U A005234 7351117,9562633
%N A005234 Primes p such that 1 + product of primes up to p is prime.
%C A005234 Conjecture: if p# + 1 is a prime number, then the next prime is less than p# + exp(1)*p. - _Arkadiusz Wesolowski_, Feb 20 2013
%C A005234 Conjecture: if p# + 1 is a prime, then the next prime is less than p# + p^2. - _Thomas Ordowski_, Apr 07 2013
%D A005234 John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 134.
%D A005234 J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 211, p. 61, Ellipses, Paris 2008.
%D A005234 H. Dubner, A new primorial prime, J. Rec. Math., 21 (No. 4, 1989), 276.
%D A005234 R. K. Guy, Unsolved Problems in Number Theory, Section A2.
%D A005234 F. Le Lionnais, Les Nombres Remarquables, Paris, Hermann, 1983, p. 109, 1983.
%D A005234 Paulo Ribenboim, The New Book of Prime Number Records, p. 13.
%D A005234 Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 4-5.
%D A005234 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%D A005234 David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 112.
%H A005234 C. K. Caldwell, <a href="https://t5k.org/primes/search.php?Description=%5E[[:digit:]]{1,}%23%2B1">Prime Pages: Database Search</a>.
%H A005234 C. K. Caldwell, <a href="https://t5k.org/glossary/page.php?sort=PrimorialPrime">Primorial Primes</a>.
%H A005234 C. K. Caldwell and Y. Gallot, <a href="http://dx.doi.org/10.1090/S0025-5718-01-01315-1">On the primality of n!+-1 and 2*3*5*...*p+-1</a>, Math. Comp., 71 (2001), 441-448.
%H A005234 H. Dubner, <a href="/A006794/a006794.pdf">Factorial and primorial primes</a>, J. Rec. Math., 19 (No. 3, 1987), 197-203. (Annotated scanned copy)
%H A005234 H. Dubner, <a href="/A005234/a005234.pdf">A new primorial prime</a>, J. Rec. Math., 21.4 (1989), 276. (Annotated scanned copy)
%H A005234 H. Dubner and N. J. A. Sloane, <a href="/A002981/a002981.pdf">Correspondence, 1991</a>.
%H A005234 Des MacHale, <a href="http://dx.doi.org/10.2307/3621650">Infinitely many proofs that there are infinitely many primes</a>, Math. Gazette, 97 (No. 540, 2013), 495-498.
%H A005234 R. Mestrovic, <a href="http://arxiv.org/abs/1202.3670">Euclid's theorem on the infinitude of primes: a historical survey of its proofs (300 BC--2012) and another new proof</a>, arXiv:1202.3670 [math.HO], 2012.
%H A005234 R. Ondrejka, <a href="http://www.utm.edu/research/primes/lists/top_ten/">The Top Ten: a Catalogue of Primal Configurations</a>.
%H A005234 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/EuclidNumber.html">Euclid Number</a>.
%H A005234 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PrimorialPrime.html">Primorial Prime</a>.
%F A005234 a(n) = A000040(A014545(n+1)). - _M. F. Hasler_, May 31 2018
%p A005234 N:= 5000: # to get all terms <= N
%p A005234 Primes:= select(isprime, [$2..N]):
%p A005234 P:= 1: count:= 0:
%p A005234 for n from 1 to nops(Primes) do
%p A005234    P:= P*Primes[n];
%p A005234    if isprime(P+1) then
%p A005234      count:= count+1; A[count]:= Primes[n]
%p A005234    fi
%p A005234 od:
%p A005234 seq(A[i],i=1..count); # _Robert Israel_, Nov 03 2015
%t A005234 (* This program is not convenient for large values of p *) p = pp = 1; Reap[While[p < 5000, p = NextPrime[p]; pp = pp*p; If[PrimeQ[1 + pp], Print[p]; Sow[p]]]][[2, 1]] (* _Jean-François Alcover_, Dec 31 2012 *)
%t A005234 With[{p = Prime[Range[200]]}, p[[Flatten[Position[Rest[FoldList[Times, 1, p]] + 1, _?PrimeQ]]]]] (* _Eric W. Weisstein_, Nov 03 2015 *)
%o A005234 (PARI) is(n)=isprime(n) && ispseudoprime(prod(i=1,primepi(n),prime(i))+1) \\ _Charles R Greathouse IV_, Feb 20 2013
%o A005234 (PARI) is(n)=isprime(n) && ispseudoprime(factorback(primes([2,n]))+1) \\ _M. F. Hasler_, May 31 2018
%o A005234 (Magma) [p:p in PrimesUpTo(3000)|IsPrime(&*PrimesUpTo(p)+1)]; // _Marius A. Burtea_, Mar 25 2019
%Y A005234 Cf. A006862 (Euclid numbers).
%Y A005234 Cf. A014545 (Primorial plus 1 prime indices: n such that 1 + (Product of first n primes) is prime).
%Y A005234 Cf. A018239 (Primorial plus 1 primes).
%Y A005234 Cf. A002110, A006794, A057704.
%K A005234 nonn,hard,more,nice,changed
%O A005234 1,1
%A A005234 _N. J. A. Sloane_
%E A005234 42209 sent in by Chris Nash (chrisnash(AT)cwix.com).
%E A005234 145823 discovered and sent in by Arlin Anderson (starship1(AT)gmail.com) and Don Robinson (donald.robinson(AT)itt.com), Jun 01 2000
%E A005234 366439, 392113 from _Eric W. Weisstein_, Mar 13 2004 (based on information in A014545)
%E A005234 a(23) from _Jeppe Stig Nielsen_, Aug 08 2024
%E A005234 a(24) from _Jeppe Stig Nielsen_, Sep 01 2024
%E A005234 a(25) from _Jeppe Stig Nielsen_, Sep 24 2024
%E A005234 a(26) from _Jeppe Stig Nielsen_, Nov 10 2024
%E A005234 a(27) from _Jeppe Stig Nielsen_, Aug 21 2025