%I #17 Aug 11 2018 20:36:06
%S 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,
%T 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,
%U 32,4,47,30,6,18,9,8,11,9,4,11,2,3,21,32,5,21,2
%N 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.
%C 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.
%C 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.
%e 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;
%e 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;
%e 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.
%t 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}]
%o (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
%Y Cf. A000040, A002375, A045917, A002372.
%K nonn,easy
%O 1,1
%A _Lei Zhou_, Jun 15 2018
|