login
Numbers k such that the sums of the first k and k+2 primes are also prime.
1

%I #29 Sep 01 2019 22:06:36

%S 2,4,12,100,122,130,204,206,214,326,328,330,332,356,458,1024,1148,

%T 1190,1418,1474,1476,1500,1524,1630,1842,1948,2128,2130,2184,2436,

%U 2448,2536,2686,2688,2784,2796,2898,2980,3112,3562,3682,3806,3936,3944,4114,4318,4332,4364,4376,4412

%N Numbers k such that the sums of the first k and k+2 primes are also prime.

%C The first run of four consecutive terms that differ by two, starts at k = 326.

%C The first run of five consecutive terms that differ by two, starts at k = 1195374. - _Daniel Suteu_, Aug 17 2019

%H Robert Israel, <a href="/A309718/b309718.txt">Table of n, a(n) for n = 1..10000</a>

%e For k=2, the sum of the first two primes 2+3 = 5 is prime. Additionally, the sum of the first k + 2=4 primes 2+3+5+7 = 17 is prime. So 2 is a term.

%e For k=6, the sum of the first six primes 2+3+5+7+11+13 = 41 is prime. But, the sum of the first k+2=8 primes 2+3+5+7+11+13+17+19 = 77 is not a prime. So 6 is not a term.

%p P:= [seq(ithprime(i),i=1..10002)]:

%p S:= ListTools:-PartialSums(P):

%p select(k -> isprime(S[k]) and isprime(S[k+2]),2*[$1..5000]); # _Robert Israel_, Sep 01 2019

%o (PARI) isspp(n) = isprime(sum(i=1, n, prime(i))); \\ A013916

%o isok(n) = isspp(n) && isspp(n+2); \\ _Michel Marcus_, Aug 14 2019

%Y Cf. A013916.

%K nonn

%O 1,1

%A _Philip Mizzi_, Aug 13 2019

%E More terms from _Michel Marcus_, Aug 14 2019