A309264 Numbers k such that s + t = k with 0 < s < t where t and t - s are both prime.
4, 7, 8, 9, 11, 12, 15, 17, 19, 20, 21, 23, 24, 25, 27, 29, 31, 32, 33, 35, 36, 39, 41, 43, 44, 45, 47, 49, 51, 53, 55, 56, 57, 59, 60, 61, 63, 65, 67, 69, 71, 72, 73, 75, 77, 79, 80, 81, 83, 84, 85, 87, 89, 91, 92, 93, 95, 97, 99, 101, 103, 104, 105, 107
Offset: 1
Keywords
Examples
4 is in the sequence since there are numbers, s=1 and t=3, that satisfy s + t = 4, where s < t, t = 3 (prime) and t - s = 3 - 1 = 2 (prime). 7 is in the sequence since there are numbers, s=2 and t=5 that satisfy s + t = 7, where s < t, t = 5 (prime) and t - s = 5 - 2 = 3 (prime).
Programs
-
Mathematica
Flatten[Table[If[Sum[(PrimePi[n - i] - PrimePi[n - i - 1]) (PrimePi[n - 2 i] - PrimePi[n - 2 i - 1]), {i, Floor[n/2]}] > 0, n, {}], {n, 100}]]
-
PARI
isok(k) = {forprime (t=1, k, if (((s = k - t) < t) && (s > 0) && isprime(t-s), return (1)););} \\ Michel Marcus, Jul 20 2019
Comments