A237705 Number of primes p < n with pi(n-p) prime, where pi(.) is given by A000720.
0, 0, 0, 0, 1, 2, 2, 3, 2, 2, 2, 1, 2, 3, 2, 3, 3, 2, 3, 3, 2, 4, 4, 3, 3, 1, 1, 3, 3, 2, 2, 1, 2, 6, 6, 5, 5, 4, 3, 5, 5, 4, 5, 5, 4, 6, 6, 6, 6, 3, 3, 5, 5, 5, 5, 2, 2, 5, 5, 3, 4, 5, 4, 8, 8, 3, 3, 1, 2, 8
Offset: 1
Keywords
Examples
a(5) = 1 since 2 and pi(5-2) = pi(3) = 2 are both prime. a(12) = 1 since 7 and pi(12-7) = pi(5) = 3 are both prime. a(15) = 2 since 3 and pi(15-3) = pi(12) = 5 are both prime, and 11 and pi(15-11) = pi(4) = 2 are both prime. a(26) = 1 since 23 and pi(26-23) = 2 are both prime. a(27) = 1 since 23 and pi(27-23) = 2 are both prime. a(32) = 1 since 29 and pi(32-29) = 2 are both prime. a(68) = 1 since 37 and pi(68-37) = pi(31) = 11 are both prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
q[n_]:=PrimeQ[PrimePi[n]] a[n_]:=Sum[If[q[n-Prime[k]],1,0],{k,1,PrimePi[n-1]}] Table[a[n],{n,1,70}]
Comments