login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A305972
a(n) is the smallest number m such that both |2n-prime(m)| and |2n-prime(m+1)| are primes, where prime(k) is the k-th prime number.
0
3, 4, 5, 2, 2, 3, 4, 2, 3, 6, 2, 3, 8, 32, 4, 21, 2, 3, 13, 9, 5, 11, 2, 3, 11, 9, 4, 16, 15, 6, 21, 2, 3, 11, 9, 5, 11, 2, 3, 18, 9, 5, 21, 97, 4, 21, 15, 6, 11, 15, 8, 11, 2, 3, 11, 2, 3, 21, 32, 4, 47, 30, 6, 18, 9, 8, 11, 9, 4, 11, 2, 3, 21, 32, 5, 21, 2
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