A376510 a(n) is the number of pairs of primes p+q=2*(n+4) with 5 <= p <= n such that either p+6 or q+6 is also prime.
1, 1, 1, 1, 2, 1, 2, 3, 2, 2, 3, 1, 3, 4, 1, 2, 4, 2, 3, 4, 3, 3, 5, 2, 3, 6, 1, 4, 6, 2, 4, 5, 4, 4, 6, 4, 4, 8, 3, 3, 8, 3, 5, 7, 2, 4, 7, 4, 5, 6, 5, 6, 9, 5, 4, 12, 3, 5, 10, 2, 5, 7, 5, 5, 6, 6, 5, 11, 5, 4, 11, 2, 7, 8, 3, 6, 10, 5, 4, 9, 7, 5, 11, 6
Offset: 1
Examples
For n=1, 2*(n+4)=10, 10=5+5, and 5+6=11 is a prime. Thus a(1)=1; For n=2, 2*(n+4)=12, 12=5+7, and 5+6=11 is a prime. Thus a(2)=1; ... For n=14, 2*(n+4)=36, 36=5+31 (5+6=11); 7+29 (7+6=13); 13+23 (13+6=19); 17+19 (17+6=23), four cases found. Thus a(14)=4.
Programs
-
Mathematica
res = {}; Do[n[2] = i*6; n[1] = n[2] - 2; n[3] = n[2] + 2; Do[c[j] = 0; p[j] = NextPrime[n[j]/2 - 1]; While[q[j] = n[j] - p[j]; If[PrimeQ[q[j]] && q[j] > 3, If[PrimeQ[p[j] + 6] || PrimeQ[q[j] + 6], c[j]++]]; p[j] < n[j] - 5, p[j] = NextPrime[p[j]]], {j, 1, 3}]; AppendTo[res, c[1]]; AppendTo[res, c[2]]; AppendTo[res, c[3]], {i, 2, 29}]; Print[res]
Comments