login
Number of primes between A002110(n) - A007504(n) and A002110(n) + A007504(n) exclusive where A002110(n) is the primorial numbers and A007504(n) is the sum of first n primes.
0

%I #21 Jun 23 2015 10:37:00

%S 0,2,4,4,4,6,5,6,14,9,9,17,14,18,16,11,23,19,23,27,25,23,28,16,33,26,

%T 25,36,36,31,40,35,37,35,39,39,33,46,51,46,48,43,46,44,44,64,66,63,53,

%U 68,60,68,53,63,52,52,62,64,68,66,66,75,80,61,84,90,88,74,70

%N Number of primes between A002110(n) - A007504(n) and A002110(n) + A007504(n) exclusive where A002110(n) is the primorial numbers and A007504(n) is the sum of first n primes.

%C Number of primes of the form A002110(2n) - A007504(2n) and A002110(2n) + A007504(2n): 0, 1, 2, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...

%e a(1) = 2 because A002110(1) - A007504(1) = 2 - 2 = 0 < (primes 2 and 3) < A002110(1) + A007504(1) = 2 + 2 = 4.

%p P:= 1: S:= 0: p:= 0: a[0]:= 0:

%p for i from 1 to 100 do

%p p:= nextprime(p);

%p P:= P*p;

%p S:= S+p;

%p a[i]:= nops(select(isprime, {$(P-S+1)..(P+S-1)}));

%p od:

%p seq(a[i],i=0..100); # _Robert Israel_, Jun 05 2015

%Y Cf. A002110, A007504.

%K nonn

%O 1,2

%A _Juri-Stepan Gerasimov_, Jun 03 2015

%E a(13) corrected and a(19) onwards from _Robert Israel_, Jun 05 2015