cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A268914 Minimum difference between two distinct primes whose sum is 2*prime(n), n>4.

This page as a plain text file.
%I A268914 #51 Mar 30 2016 23:06:57
%S A268914 12,12,12,24,12,24,24,12,24,48,12,12,24,36,12,24,12,36,48,36,60,24,12,
%T A268914 12,60,48,48,36,60,24,36,24,12,72,60,12,24,36,84,60,60,84,24,120,60,
%U A268914 96,12,24,60,24,12,12,24,84,12,24,108,48,48,84,72,72,36,60,72,36,12,84,60,12,60,72,60,48,36,24,60,24,24,48,36,48,36,168,36,48
%N A268914 Minimum difference between two distinct primes whose sum is 2*prime(n), n>4.
%C A268914 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.
%C A268914 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.
%H A268914 Barry Cherkas, <a href="/A268914/b268914.txt">Table of n, a(n) for n = 5..10003</a>
%H A268914 G. H. Hardy and J. E. Littlewood, <a href="http://fuchs-braun.com/media/8cdd73c813c342f8ffff80d1fffffff0.pdf">Some Problems of 'Partitio Numerorum.' III. On the Expression of a Number as a Sum of Primes</a>, Acta Math. 44, 1-70, 1923.
%F A268914 a(n) = 2*A078611(n+2).
%e A268914 For n=5, 2*prime(5)=2*11=5+17 and 17-5=12.
%e A268914 For n=6, 2*prime(6)=2*13=7+19 and 19-7=12.
%e A268914 ...
%e A268914 For n=8, 2*prime(8)=2*19=7+31 and 31-7=24.
%p A268914 N:= 1000: # to get a(5) .. a(N)
%p A268914 p:= 7:
%p A268914 for n from 5 to N do
%p A268914   p:= nextprime(p);
%p A268914   for k from 6 by 6 while not isprime(p+k) or not isprime(p-k) do od:
%p A268914   A[n]:= 2*k
%p A268914 od:
%p A268914 seq(A[n],n=5..N); # _Robert Israel_, Mar 09 2016
%t A268914 f[n_]:=Block[{p=Prime[n],k},k=p+6;
%t A268914 While[!PrimeQ[k]||!PrimeQ[2p-k],k=k+6];2(k-p)];
%t A268914 seq=Reap[Do[Sow[f[n]],{n,5,200}]][[2]][[1]];
%t A268914 seq
%t A268914 (*For large data sets (say, N>5000), replace 200 with N and the above algorithm is comparatively efficient.*)
%t A268914 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 *)
%o A268914 (PARI) a(n) = {p = prime(n); d = 2; while (! (isprime(p-d) && isprime(p+d)),  d+=2); 2*d;} \\ _Michel Marcus_, Mar 17 2016
%Y A268914 Cf. A078611, A071681, A139602, A006489, A137796, A161723, A128940.
%K A268914 nonn,easy
%O A268914 5,1
%A A268914 _Barry Cherkas_, Feb 15 2016