OFFSET
1,2
COMMENTS
The author of the sequence conjectures that a(n) >= 1 for all n. This conjecture is similar to the famous conjecture made by Adrien-Marie Legendre that there is always a prime between n^2 and (n+1)^2, see A014085. - Antti Karttunen, May 01 2017
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
For n = 1, the primes from 2*((1-1)^2) to 2*(1^2) (in semiopen range ]0, 2]) are: 2, thus a(1) = 1.
For n = 2, the primes from 2*((2-1)^2) to 2*(2^2) (in semiopen range ]2, 8]) are: 3, 5 and 7, thus a(2) = 3.
For n = 3, the primes from 2*((3-1)^2) to 2*(3^2) (in semiopen range ]8, 18]) are: 11, 13 and 17, thus a(3) = 3.
For n = 4, the primes from 2*((4-1)^2) to 2*(4^2) (in semiopen range ]18, 32]) are: 19, 23, 29 and 31, thus a(4) = 4.
MAPLE
R:= [0, seq(numtheory:-pi(2*n^2), n=1..100)]:
R[2..-1] - R[1..-2]; # Robert Israel, May 01 2017
MATHEMATICA
Table[Length[Select[FactorInteger[Numerator[Table[2^(1 - 2 n^2) n Binomial[2 n^2, n^2], {n, 1, k}]]][[k]][[All, 1]], # > 2 (k - 1)^2 &]], {k, 1, 60}]
Flatten[{1, 2, Table[PrimePi[2 k^2] - PrimePi[2 (k - 1)^2], {k, 3, 60}]}]
(* Second program: *)
Array[PrimePi[2 #^2] - PrimePi[2 (# - 1)^2] &, 60] (* Michael De Vlieger, Apr 26 2017, at the suggestion of Robert G. Wilson v. *)
PROG
(PARI) a(n) = (primepi(2*n^2)-primepi(2*(n-1)^2)) \\ David A. Corneth, Apr 27 2017, edited by Antti Karttunen, May 01 2017
(PARI) a(n)=my(s); forprime(p=2*n^2 - 4*n + 3, 2*n^2, s++); s \\ Charles R Greathouse IV, May 10 2017
(Python)
from sympy import primepi
def a(n): return primepi(2*n**2) - primepi(2*(n - 1)**2) # Indranil Ghosh, May 01 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Steiner, Apr 26 2017
EXTENSIONS
Definition and value of a(2) changed by Antti Karttunen, May 01 2017
STATUS
approved