%I M0669 #101 Sep 24 2024 05:38:03
%S 2,3,5,7,11,31,379,1019,1021,2657,3229,4547,4787,11549,13649,18523,
%T 23801,24029,42209,145823,366439,392113,4328927,5256037,6369619
%N Primorial plus 1 primes: primes p such that 1 + product of primes up to p is prime.
%C 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 Conjecture: if p# + 1 is a prime, then the next prime is less than p# + p^2. - _Thomas Ordowski_, Apr 07 2013
%D J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 211, p. 61, Ellipses, Paris 2008.
%D H. Dubner, A new primorial prime, J. Rec. Math., 21 (No. 4, 1989), 276.
%D R. K. Guy, Unsolved Problems in Number Theory, Section A2.
%D F. Le Lionnais, Les Nombres Remarquables, Paris, Hermann, 1983, p. 109, 1983.
%D Paulo Ribenboim, The New Book of Prime Number Records, p. 13.
%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
%D David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987. See p. 112.
%H C. K. Caldwell, <a href="https://t5k.org/primes/search.php?Description=%5E[[:digit:]]{1,}%23%2B1">Prime Pages: Database Search</a>.
%H C. K. Caldwell, <a href="https://t5k.org/glossary/page.php?sort=PrimorialPrime">Primorial Primes</a>.
%H 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 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 H. Dubner, <a href="/A005234/a005234.pdf">A new primorial prime</a>, J. Rec. Math., 21.4 (1989), 276. (Annotated scanned copy)
%H H. Dubner and N. J. A. Sloane, <a href="/A002981/a002981.pdf">Correspondence, 1991</a>.
%H 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 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 R. Ondrejka, <a href="http://www.utm.edu/research/primes/lists/top_ten/">The Top Ten: a Catalogue of Primal Configurations</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/EuclidNumber.html">Euclid Number</a>.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PrimorialPrime.html">Primorial Prime</a>.
%F a(n) = A000040(A014545(n+1)). - _M. F. Hasler_, May 31 2018
%p N:= 5000: # to get all terms <= N
%p Primes:= select(isprime, [$2..N]):
%p P:= 1: count:= 0:
%p for n from 1 to nops(Primes) do
%p P:= P*Primes[n];
%p if isprime(P+1) then
%p count:= count+1; A[count]:= Primes[n]
%p fi
%p od:
%p seq(A[i],i=1..count); # _Robert Israel_, Nov 03 2015
%t (* 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 With[{p = Prime[Range[200]]}, p[[Flatten[Position[Rest[FoldList[Times, 1, p]] + 1, _?PrimeQ]]]]] (* _Eric W. Weisstein_, Nov 03 2015 *)
%o (PARI) is(n)=isprime(n) && ispseudoprime(prod(i=1,primepi(n),prime(i))+1) \\ _Charles R Greathouse IV_, Feb 20 2013
%o (PARI) is(n)=isprime(n) && ispseudoprime(factorback(primes([2,n]))+1) \\ _M. F. Hasler_, May 31 2018
%o (Magma) [p:p in PrimesUpTo(3000)|IsPrime(&*PrimesUpTo(p)+1)]; // _Marius A. Burtea_, Mar 25 2019
%Y Cf. A006862 (Euclid numbers).
%Y Cf. A014545 (Primorial plus 1 prime indices: n such that 1 + (Product of first n primes) is prime).
%Y Cf. A018239 (Primorial plus 1 primes).
%Y Cf. A002110, A006794, A057704.
%K nonn,hard,more,nice
%O 1,1
%A _N. J. A. Sloane_
%E 42209 sent in by Chris Nash (chrisnash(AT)cwix.com).
%E 145823 discovered and sent in by Arlin Anderson (starship1(AT)gmail.com) and Don Robinson (donald.robinson(AT)itt.com), Jun 01 2000
%E 366439, 392113 from _Eric W. Weisstein_, Mar 13 2004 (based on information in A014545)
%E a(23) from _Jeppe Stig Nielsen_, Aug 08 2024
%E a(24) from _Jeppe Stig Nielsen_, Sep 01 2024
%E a(25) from _Jeppe Stig Nielsen_, Sep 24 2024