login
Lesser members of twin primes which are the sum of the first k primes for some number k.
2

%I #35 Sep 26 2021 16:08:03

%S 5,17,41,197,281,38921,121631,325019,642869,681257,1005551,1086557,

%T 2327399,4975457,7584569,7819787,8130767,8522159,14848187,17769377,

%U 18615677,19949537,20144051,21171191,24845207,33669047,35166449,56039957,73479947,82366769,92731367

%N Lesser members of twin primes which are the sum of the first k primes for some number k.

%H Sebastian Sargenti, <a href="/A346706/b346706.txt">Table of n, a(n) for n = 1..128</a>

%e 5 = 2+3; 5 is a twin prime with 7.

%e 17 = 2+3+5+7; 17 is a twin prime with 19.

%e 41 = 2+3+5+7+11+13; 41 is a twin prime with 43.

%e 197 = 2+3+5+7+11+13+17+19+23+29+31+37; 197 is a twin prime with 199.

%t Select[Accumulate @ Select[Range[45000], PrimeQ], PrimeQ[#] && PrimeQ[# + 2] &] (* _Amiram Eldar_, Aug 01 2021 *)

%o (Python)

%o from itertools import accumulate

%o from sympy import isprime, primerange

%o list(filter(lambda p: isprime(p) and isprime(p+2), accumulate(primerange(2, 10000)))) # _David Radcliffe_, Aug 01 2021

%o (PARI) lista(nn) = {my(s=0); for (n=1, nn, s += prime(n); if (isprime(s) && isprime(s+2), print1(s, ", ")););} \\ _Michel Marcus_, Aug 21 2021

%Y Cf. A000040, A007504.

%Y Intersection of A001359 and A013918.

%K nonn

%O 1,1

%A _Sebastian Sargenti_, Jul 29 2021

%E a(13)-a(31) from _Jon E. Schoenfield_, Jul 29 2021