login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the least prime of the form x+2 where x is the product of n consecutive primes.
2

%I #14 Jan 29 2022 12:40:51

%S 3,5,17,107,215443,15017,1616617,19657257924643,8618654420263,

%T 3234846617,100280245067,3710369067407,

%U 19818939413097309267215847601753,102481630431415237,307444891294245707,320460058359035439847,961380175077106319537

%N a(n) is the least prime of the form x+2 where x is the product of n consecutive primes.

%H Robert Israel, <a href="/A348430/b348430.txt">Table of n, a(n) for n = 0..222</a>

%e a(4) = 17*19*23*29+2 because that is prime while 2*3*5*7+2, 3*5*7*11+2, ..., 13*17*19*23+2 are not.

%p f:= proc(n) local P, i, r;

%p P:= mul(ithprime(i), i=2..n+1);

%p for i from 2 do

%p r:= P+2;

%p if isprime(r) then return r fi;

%p P:= P/ithprime(i)*ithprime(i+n);

%p od

%p end proc:

%p map(f, [$0..20]);

%t a[n_] := Module[{x = Product[Prime[i], {i, 2, n + 1}], p1 = 3, p2 = Prime[n + 2]}, While[! PrimeQ[x + 2], x *= (p2/p1); p1 = NextPrime[p1]; p2 = NextPrime[p2]]; x + 2]; Array[a, 17, 0] (* _Amiram Eldar_, Jan 25 2022 *)

%Y Cf. A347866, A083562.

%K nonn

%O 0,1

%A _J. M. Bergot_ and _Robert Israel_, Jan 25 2022