A237582 a(n) = |{0 < k < n: pi(n + k^2) is prime}|, where pi(.) is given by A000720.
0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 4, 1, 2, 2, 3, 6, 6, 5, 5, 5, 5, 6, 7, 7, 6, 5, 6, 5, 6, 7, 8, 9, 8, 10, 9, 8, 6, 6, 6, 6, 7, 9, 9, 10, 11, 11, 13, 11, 9, 9, 10, 10, 8, 6, 6, 5, 4, 8, 9, 10, 12, 11, 14, 15, 15, 15, 12, 14, 15, 17, 16, 13, 11, 11, 13, 16, 18, 24, 25, 20
Offset: 1
Keywords
Examples
a(5) = 1 since pi(5 + 1^2) = 3 is prime. a(6) = 1 since pi(6 + 5^2) = pi(31) = 11 is prime. a(9) = 2 since pi(9 + 3^2) = pi(18) = 7 and pi(9 + 5^2) = pi(34) = 11 are both prime. a(12) = 1 since pi(12 + 10^2) = pi(112) = 29 is prime.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..2000
- Z.-W. Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014
Programs
-
Mathematica
p[n_]:=PrimeQ[PrimePi[n]] a[n_]:=Sum[If[p[n+k^2],1,0],{k,1,n-1}] Table[a[n],{n,1,80}]
Comments