login
A317597
a(n) is the smallest even number for which there are n prime numbers between a(n) and the largest prime number p such that a(n)-p is also a prime.
0
10, 4, 128, 98, 308, 488, 1118, 3818, 1928, 2438, 992, 2642, 5372, 7426, 9596, 64838, 54244, 48002, 22832, 100768, 103738, 63274, 194470, 194428, 128168, 180596, 986332, 850712, 1403372, 880508, 3619208, 5960648, 503222, 4454768, 2209532, 3526958, 4445372
OFFSET
0,1
EXAMPLE
For n=0, 10 = 7 + 3 is the smallest even number such that there is no prime between 7 and 10, so a(0)=10;
for n=1, 4 = 2 + 2 is the smallest even number such that there is only one prime between 2 and 4, which is 3, so a(1)=4;
for n=2, 128 = 109 + 19, there are two primes between 109 and 128, which are 113 and 127, for which a(n)-p = 15 and 1 respectively, and both nonprime. There is no smaller even number having exactly 2 such primes, so a(2)=128.
MATHEMATICA
fa = {}; n = 2; efa = 0; While[efa < 37, n = n + 2; p = NextPrime[n];
ct = 0; While[p = NextPrime[p, -1]; ! PrimeQ[n - p], ct++];
While[ct > (Length[fa] - 2), AppendTo[fa, 0]];
If[fa[[ct + 1]] == 0, fa[[ct + 1]] = n];
While[fa[[efa + 1]] > 0, efa++]]; Part[fa, 1;; efa]
CROSSREFS
Cf. A317595.
Sequence in context: A216653 A267180 A038306 * A357423 A320938 A117256
KEYWORD
nonn
AUTHOR
Lei Zhou, Aug 01 2018
STATUS
approved