login
Primes from which subtracting the sum of the first k primes does not yield another prime, for any k.
0

%I #15 Dec 15 2022 21:24:12

%S 2,3,11,37,67,97,127,157,211,223,277,307,337,367,373,379,397,409,439,

%T 727,739,769,853,937,967,991,1069,1129,1171,1399,1447,1567,1579,1597,

%U 1693,1753,1777,1783,1831,1861,1987,2203,2617,3067,3109,3793,4561,4603,4783,4993,5323,5431,5557,6211,6373,7741

%N Primes from which subtracting the sum of the first k primes does not yield another prime, for any k.

%C The greater prime p of a twin prime pair is never a term, since p-2 is the lesser prime of that pair. Terms of A013918 are not terms here either because at the (k-1)-th subtraction the result is the k-th prime.

%C Given comments in A090304, the last term is likely a(56) = 7741. - _Michael S. Branicky_, Dec 03 2022

%e 11 is a term because 11 - 2 = 9, 11 - (2 + 3) = 6, 11 - (2 + 3 + 5) = 1, and none of these are prime.

%e 17 is not a term because 17 - (2 + 3 + 5) = 7, which is prime.

%t primeQ[n_] := n > 0 && PrimeQ[n]; With[{p = Prime[Range[1000]]}, s = Accumulate[p]; q[n_] := AllTrue[s, ! primeQ[n - #] &]; Select[p, q]] (* _Amiram Eldar_, Dec 04 2022 *)

%Y Primes in A090304.

%Y Cf. A000040, A007504.

%K nonn

%O 1,1

%A _Tamas Sandor Nagy_, Dec 03 2022

%E More terms from _Michael S. Branicky_, Dec 03 2022