Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #103 Aug 01 2017 06:13:32
%S 1,3,3,4,4,5,5,6,6,9,7,8,7,9,10,10,9,12,10,11,13,11,14,13,14,13,14,16,
%T 16,15,15,16,17,18,19,14,22,19,18,16,22,18,24,20,22,22,20,23,24,22,23,
%U 21,25,27,24,27,26,25,27,25,23,33,28,25,29,28,31,30,33,29
%N Number of primes p with 2(n-1)^2 < p <= 2n^2.
%C 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
%H Robert Israel, <a href="/A285786/b285786.txt">Table of n, a(n) for n = 1..10000</a>
%F From _Antti Karttunen_, May 01 2017: (Start)
%F a(1) = 1, for n > 1, a(n) = A000720(A001105(n)) - A000720(A001105(n-1)).
%F For all n except n=2, a(n) <= n.
%F (End)
%F First differences of A278114: a(n) = A278114(n) - A278114(n-1) for n > 0, if we use A278114(0) = 0. A278114(n) = Sum_{k=1..n} a(n). - _M. F. Hasler_, May 02 2017
%e 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.
%e 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.
%e 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.
%e 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.
%p R:= [0, seq(numtheory:-pi(2*n^2),n=1..100)]:
%p R[2..-1] - R[1..-2]; # _Robert Israel_, May 01 2017
%t 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}]
%t Flatten[{1,2,Table[PrimePi[2 k^2] - PrimePi[2 (k - 1)^2], {k, 3, 60}]}]
%t (* Second program: *)
%t Array[PrimePi[2 #^2] - PrimePi[2 (# - 1)^2] &, 60] (* _Michael De Vlieger_, Apr 26 2017, at the suggestion of _Robert G. Wilson v_. *)
%o (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
%o (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
%o (Python)
%o from sympy import primepi
%o def a(n): return primepi(2*n**2) - primepi(2*(n - 1)**2) # _Indranil Ghosh_, May 01 2017
%Y Cf. A001105, A000720 (number of primes), A014085 (between n^2 and (n+1)^2), A285738, A285388.
%K nonn
%O 1,2
%A _Ralf Steiner_, Apr 26 2017
%E Definition and value of a(2) changed by _Antti Karttunen_, May 01 2017