OFFSET
5,1
COMMENTS
If p>4 is prime, any two primes that add to 2p must be equidistant from p. If p is congruent to 1 Mod 3, then p+2 and p-4 are divisible by 3. Alternatively, if p is congruent to 2 Mod 3, the p-2 and p+4 are divisible by 3. Thus, the equidistant pairs (p-2,p+2) and (p-4,p+4) cannot be primes that add to 2p. On the other hand, adding or subtracting any multiple of 6 will be congruent to the same congruence class as p and may be prime. Thus, the minimal difference between distinct primes that add to p must be a multiple of 12.
Extrapolating from computational evidence for all primes up to 10^9, we conjecture: For each multiple of 12 there are infinitely many primes p such that p-6k and p+6k are prime and 12k is the minimal difference for two distinct primes whose sum is 2p.
LINKS
Barry Cherkas, Table of n, a(n) for n = 5..10003
G. H. Hardy and J. E. Littlewood, Some Problems of 'Partitio Numerorum.' III. On the Expression of a Number as a Sum of Primes, Acta Math. 44, 1-70, 1923.
FORMULA
a(n) = 2*A078611(n+2).
EXAMPLE
For n=5, 2*prime(5)=2*11=5+17 and 17-5=12.
For n=6, 2*prime(6)=2*13=7+19 and 19-7=12.
...
For n=8, 2*prime(8)=2*19=7+31 and 31-7=24.
MAPLE
N:= 1000: # to get a(5) .. a(N)
p:= 7:
for n from 5 to N do
p:= nextprime(p);
for k from 6 by 6 while not isprime(p+k) or not isprime(p-k) do od:
A[n]:= 2*k
od:
seq(A[n], n=5..N); # Robert Israel, Mar 09 2016
MATHEMATICA
f[n_]:=Block[{p=Prime[n], k}, k=p+6;
While[!PrimeQ[k]||!PrimeQ[2p-k], k=k+6]; 2(k-p)];
seq=Reap[Do[Sow[f[n]], {n, 5, 200}]][[2]][[1]];
seq
(*For large data sets (say, N>5000), replace 200 with N and the above algorithm is comparatively efficient.*)
Table[2 SelectFirst[Range[#/2], Function[k, AllTrue[{#/2 + k, #/2 - k}, PrimeQ]]] &[2 Prime@ n], {n, 5, 120}] (* Michael De Vlieger, Mar 09 2016, Version 10 *)
PROG
(PARI) a(n) = {p = prime(n); d = 2; while (! (isprime(p-d) && isprime(p+d)), d+=2); 2*d; } \\ Michel Marcus, Mar 17 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Barry Cherkas, Feb 15 2016
STATUS
approved