login
a(n) is the first prime that is (product minus sum) of a sequence of 2*n consecutive primes.
4

%I #8 Dec 02 2025 21:26:02

%S 7,193,29989,1985383050388081,100280244907,1768926654228131160013897,

%T 13082761331669749,345838388442298632369626737513,

%U 20752693410326487146559341738976742800539,1253894832308423555527687468775077849,8903838997318993853815253656003369523368299760147856304541019312543

%N a(n) is the first prime that is (product minus sum) of a sequence of 2*n consecutive primes.

%C a(n) is the least prime of the form Product_{k=i..i+2*n-1} prime(k) - Sum_{k=i..i+2*n-1} prime(k).

%H Robert Israel, <a href="/A390935/b390935.txt">Table of n, a(n) for n = 1..115</a>

%e a(1) = 7 because 7 = 3*5 - (3+5) is prime where 3 and 5 are two consecutive primes, while 2*3 - (2+3) = 1 is not prime.

%p f:= proc(n) local L,i,v;

%p L:= [seq(ithprime(i),i=1..2*n)]:

%p do

%p v:= convert(L,`*`)-convert(L,`+`);

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

%p L:= [seq(L[i],i=2..2*n),nextprime(L[2*n])]

%p od:

%p end proc:

%p map(f, [$1..12]);

%Y Cf. A096345, A387590, A387946, A390916, A390933.

%K nonn

%O 1,1

%A _Will Gosnell_ and _Robert Israel_, Nov 24 2025