A237817 Number of primes p < n such that r = |{q <= n-p: q and q + 2 are both prime}| and r + 2 are both prime.
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 8, 7, 6, 6, 5, 5, 5, 5, 5, 5, 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 4, 4, 4
Offset: 1
Keywords
Examples
a(13) = 1 since {q <= 13 - 2: q and q + 2 are both prime} = {3, 5, 11} has cardinality 3, and {3, 3 + 2} is a twin prime pair.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Z.-W. Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014
Programs
-
Mathematica
TQ[n_]:=PrimeQ[n]&&PrimeQ[n+2] sum[n_]:=Sum[If[PrimeQ[Prime[k]+2],1,0],{k,1,PrimePi[n]}] a[n_]:=Sum[If[TQ[sum[n-Prime[k]]],1,0],{k,1,PrimePi[n-1]}] Table[a[n],{n,1,80}]
Comments