login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A217721
Number of primes between n^2 - log_2(n)^2 and n^2 (inclusive).
1
0, 1, 1, 1, 1, 1, 2, 2, 3, 2, 1, 2, 3, 2, 2, 2, 3, 4, 4, 3, 3, 2, 3, 4, 4, 3, 3, 3, 5, 4, 4, 4, 2, 2, 4, 5, 2, 5, 2, 3, 4, 4, 3, 4, 5, 5, 3, 5, 7, 2, 3, 6, 6, 4, 5, 3, 3, 5, 6, 4, 5, 3, 3, 4, 4, 4, 4, 4, 4, 3, 5, 5, 4, 4, 2, 4, 4, 5, 5, 6, 5, 6, 5, 4, 6, 2, 7
OFFSET
1,7
COMMENTS
Conjecture: a(n) > 0 for n > 1.
Conjecture checked up to n = 2^28 - 1.
MATHEMATICA
Table[Length[Select[Range[n^2, n^2 - Log[2, n]^2, -1], PrimeQ]], {n, 100}] (* T. D. Noe, Mar 21 2013 *)
PROG
(Python)
import math
def isprime(k):
s = 3
while s*s <= k:
if k%s==0: return 0
s+=2
return 1
for n in range(1, 333):
c = 0
top = n*n
for i in range(top - int(math.log(n, 2)**2), top):
if i&1: c += isprime(i)
print(str(c), end=', ')
CROSSREFS
KEYWORD
nonn
AUTHOR
Alex Ratushnyak, Mar 21 2013
STATUS
approved