A329251 Let P1 >= 3, P2, P3 be consecutive primes, with P3 - P2 = 2. a(n) = (P2 + P3)/12 for the first occurrence of (P2 - P1)/2 = n.
1, 2, 5, 0, 25, 87, 0, 325, 213, 0, 192, 758, 0, 500, 1158, 0, 1668, 5383, 0, 4217, 13130, 0, 15180, 4713, 0, 5955, 19583, 0, 66642, 17127, 0, 48108, 49485, 0, 28905, 171005, 0, 175530, 61838, 0, 314192, 76967, 0, 192637, 96147, 0, 812768, 708780, 0
Offset: 1
Keywords
Examples
a(5) = 25 because the prime gap immediately before P2 = 25*6 - 1 = 149, P3 = 25*6 + 1 = 151 is the first such gap with length 2*n = 2*5 = 10. P2 - P1 = 149 - 139 =10.
Links
- Hugo Pfoertner, Table of n, a(n) for n = 1..224
Programs
-
Mathematica
Module[{nn=500000,lst},lst={(#[[2]]-#[[1]])/2,(#[[2]]+#[[3]])/12}&/@ Select[ Partition[Prime[Range[2,nn]],3,1],#[[3]]-#[[2]]==2&];Table[ SelectFirst[ lst,#[[1]]==n&],{n,50}]/.Missing["NotFound"]->{0,0}] [[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Nov 04 2020 *)
-
PARI
my(v=vector(70), p1=3, p2=5, d); forprime(p3=7, 5e6, if(p3-p2==2, d=(p2-p1)/2; if(v[d]==0, v[d]=(p2+p3)/12)); p1=p2; p2=p3); v[1..49]
Comments