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.

Original entry on oeis.org

2, 3, 5, 7, 11, 31, 379, 1019, 1021, 2657, 3229, 4547, 4787, 11549, 13649, 18523, 23801, 24029, 42209, 145823, 366439, 392113, 4328927, 5256037, 6369619, 7351117, 9562633
Offset: 1

Views

Author

Keywords

Comments

Conjecture: if p# + 1 is a prime number, then the next prime is less than p# + exp(1)*p. - Arkadiusz Wesolowski, Feb 20 2013
Conjecture: if p# + 1 is a prime, then the next prime is less than p# + p^2. - Thomas Ordowski, Apr 07 2013

References

  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See p. 134.
  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 211, p. 61, Ellipses, Paris 2008.
  • H. Dubner, A new primorial prime, J. Rec. Math., 21 (No. 4, 1989), 276.
  • R. K. Guy, Unsolved Problems in Number Theory, Section A2.
  • F. Le Lionnais, Les Nombres Remarquables, Paris, Hermann, 1983, p. 109, 1983.
  • Paulo Ribenboim, The New Book of Prime Number Records, p. 13.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 4-5.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 112.

Crossrefs

Cf. A006862 (Euclid numbers).
Cf. A014545 (Primorial plus 1 prime indices: n such that 1 + (Product of first n primes) is prime).
Cf. A018239 (Primorial plus 1 primes).

Programs

  • Magma
    [p:p in PrimesUpTo(3000)|IsPrime(&*PrimesUpTo(p)+1)]; // Marius A. Burtea, Mar 25 2019
  • Maple
    N:= 5000: # to get all terms <= N
    Primes:= select(isprime, [$2..N]):
    P:= 1: count:= 0:
    for n from 1 to nops(Primes) do
       P:= P*Primes[n];
       if isprime(P+1) then
         count:= count+1; A[count]:= Primes[n]
       fi
    od:
    seq(A[i],i=1..count); # Robert Israel, Nov 03 2015
  • Mathematica
    (* 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 *)
    With[{p = Prime[Range[200]]}, p[[Flatten[Position[Rest[FoldList[Times, 1, p]] + 1, ?PrimeQ]]]]] (* _Eric W. Weisstein, Nov 03 2015 *)
  • PARI
    is(n)=isprime(n) && ispseudoprime(prod(i=1,primepi(n),prime(i))+1) \\ Charles R Greathouse IV, Feb 20 2013
    
  • PARI
    is(n)=isprime(n) && ispseudoprime(factorback(primes([2,n]))+1) \\ M. F. Hasler, May 31 2018
    

Formula

a(n) = A000040(A014545(n+1)). - M. F. Hasler, May 31 2018

Extensions

42209 sent in by Chris Nash (chrisnash(AT)cwix.com).
145823 discovered and sent in by Arlin Anderson (starship1(AT)gmail.com) and Don Robinson (donald.robinson(AT)itt.com), Jun 01 2000
366439, 392113 from Eric W. Weisstein, Mar 13 2004 (based on information in A014545)
a(23) from Jeppe Stig Nielsen, Aug 08 2024
a(24) from Jeppe Stig Nielsen, Sep 01 2024
a(25) from Jeppe Stig Nielsen, Sep 24 2024
a(26) from Jeppe Stig Nielsen, Nov 10 2024
a(27) from Jeppe Stig Nielsen, Aug 21 2025