OFFSET
1,2
COMMENTS
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..3000
Z.-W. Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014
EXAMPLE
a(9) = 1 since the interval (0, 9] contains exactly 2^2 = 4 primes.
a(13) = 1 since the interval (9*13, 10*13] contains exactly 1^2 = 1 prime.
MATHEMATICA
SQ[n_]:=IntegerQ[Sqrt[n]]
d[k_, n_]:=PrimePi[(k+1)*n]-PrimePi[k*n]
a[n_]:=Sum[If[SQ[d[k, n]], 1, 0], {k, 0, n-1}]
Table[a[n], {n, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 22 2014
STATUS
approved