OFFSET
1,1
COMMENTS
In the sequence {a(n)}, the following 30 values of n are the only ones for which prime(a(n)+1) > 2n: 1, 2, 3, 14, 16, 19, 28, 31, 44, 59, 61, 62, 79, 103, 104, 106, 124, 163, 166, 209, 229, 239, 259, 272, 314, 404, 691, 859, 1483, 2011.
Except for the above values of n, the number pairs (prime(a(n)), 2n-prime(a(n))) and (prime(a(n)+1), 2n-prime(a(n)+1)) are the Goldbach decompositions of 2n.
EXAMPLE
For n=1, 2n=2, both |2-5|=3 and |2-7|=5 are primes, and 5 is the 3rd prime, so a(1)=3;
For n=4, 2n=8, both 8-3=5 and 8-5=3 are primes, and 3 is the 2nd prime, so a(4)=2;
For n=13, 2n=26, both 26-prime(8)=26-19=7 and 26-prime(8+1)=26-23=3 are primes, and no smaller primes satisfy the definition, so a(13)=8.
MATHEMATICA
Table[k=1; i=2*n; p=Prime[k]; While[!((PrimeQ[i-p]) && (PrimeQ[i-NextPrime[p]])), k++; p=NextPrime[p]]; If[Prime[k+1]>i, AppendTo[s4, i]]; k, {n, 1, 77}]
PROG
(PARI) a(n) = {my(k=1); while (! (isprime(abs(2*n-prime(k))) && isprime(abs(2*n-prime(k+1)))), k++); k; } \\ Michel Marcus, Jun 22 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Lei Zhou, Jun 15 2018
STATUS
approved