%I #89 Sep 24 2024 05:38:34
%S 0,1,2,3,4,5,11,75,171,172,384,457,616,643,1391,1613,2122,2647,2673,
%T 4413,13494,31260,33237,304723,365071,436504
%N Primorial plus 1 prime indices: k such that k-th Euclid number A006862(k) = 1 + (Product of first k primes) is prime.
%C The prime referenced by the final term of the sequence above (a(23) = 33237) has 169966 digits. - _Harvey P. Dale_, May 04 2012
%D J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 211, p. 61, Ellipses, Paris 2008.
%H C. K. Caldwell, <a href="https://t5k.org/primes/search.php?Description=%5E[[:digit:]]{1,}%23%2B1&Style=HTML">Prime Pages: Database Search</a>
%H C. K. Caldwell, <a href="https://t5k.org/glossary/page.php?sort=PrimorialPrime">Primorial Primes</a>.
%H H. Ibstedt, <a href="http://vixra.org/abs/1403.0853">A Few Smarandache Sequences</a>, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 170-183.
%H Benny Lim, <a href="https://www.parabola.unsw.edu.au/2010-2019/volume-54-2018/issue-3/article/prime-numbers-generated-highly-composite-numbers">Prime Numbers Generated From Highly Composite Numbers</a>, Parabola (2018) Vol. 54, Issue 3.
%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>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/IntegerSequencePrimes.html">Integer Sequence Primes</a>
%F a(n+1) = A000720(A005234(n)). - _M. F. Hasler_, May 31 2018
%e a(1) = 0 because the (empty) product of 0 primes is 1, plus 1 yields the prime 2.
%e prime(4413) = 42209 and Primorial(4413) + 1 = 42209# + 1 is a 18241-digit prime.
%e prime(13494) = 145823 and Primorial(13494) + 1 = 145823# + 1 is a 63142-digit prime.
%p P:= 1:
%p p:= 1:
%p count:= 0:
%p for n from 1 to 1000 do
%p p:= nextprime(p);
%p P:= P*p;
%p if isprime(P+1) then
%p count:= count+1;
%p A[count]:= n;
%p fi
%p od:
%p seq(A[i], i=1..count); # _Robert Israel_, Nov 04 2015
%t Flatten[Position[Rest[FoldList[Times,1,Prime[Range[180]]]]+1,_?PrimeQ]] (* _Harvey P. Dale_, May 04 2012 *) (* this program generates the first 9 positive terms of the sequence; changing the Range constant to 33237 will generate all 23 terms above, but it will take a long time to do so *)
%o (PARI) is(n)=ispseudoprime(prod(i=1,n,prime(i))+1) \\ _Charles R Greathouse IV_, Mar 21 2013
%o (PARI) P=1; n=0; forprime(p=1, 10^5, if(ispseudoprime(P+1), print1(n", ")); n=n+1; P*=p;) \\ _Hans Loeblich_, May 10 2019
%Y Cf. A005234 (values of p such that 1 + product of primes <= p is prime).
%Y Cf. A018239 (primorial plus 1 primes).
%Y Cf. A002110, A006862, A057704.
%K nonn,nice,hard,more
%O 1,3
%A _Eric W. Weisstein_, _Murray R. Bremner_
%E More terms from _Labos Elemer_
%E a(21) from Arlin Anderson (starship1(AT)gmail.com), Oct 20 2000
%E a(22)-a(23) from _Eric W. Weisstein_, Mar 13 2004 (based on information in A057704)
%E Offset and first term changed by _Altug Alkan_, Nov 27 2015
%E a(24) from _Jeppe Stig Nielsen_, Aug 08 2024
%E a(25) from _Jeppe Stig Nielsen_, Sep 01 2024
%E a(26) from _Jeppe Stig Nielsen_, Sep 24 2024