%I #51 Oct 22 2024 02:56:21
%S 1,1,1,2,1,2,2,2,3,4,3,4,3,3,4,5,4,4,4,4,5,6,5,6,6,6,7,7,6,7,7,7,7,8,
%T 8,9,9,9,9,10,9,10,9,9,10,10,9,9,10,10,11,12,11,12,13,13,14,14,13,13,
%U 12,12,12,13,13,14,13,13,14,15,14,14,13,13,14,15,15,15,15,15,15,16,15,16
%N a(n) = pi(2*n) - pi(n). Number of primes in the interval (n,2n].
%C a(n) < log(4)*n/log(n) < 7*n/(5*log(n)) for n > 1. - _Reinhard Zumkeller_, Mar 04 2008
%C Bertrand's postulate is equivalent to the formula a(n) >= 1 for all positive integers n. - _Jonathan Vos Post_, Jul 30 2008
%C Number of distinct prime factors > n of binomial(2*n,n). - _T. D. Noe_, Aug 18 2011
%C f(2, 2n) - f(3, n) < a(n) < f(3, 2n) - f(2, n) for n > 5889 where f(k, x) = x/log x * (1 + 1/log x + k/(log x)^2). The constant 3 can be improved. - _Charles R Greathouse IV_, May 02 2012
%C For n >= 2, a(n) is the number of primes appearing in the 2nd row of an n X n square array whose elements are the numbers from 1..n^2, listed in increasing order by rows. - _Wesley Ivan Hurt_, May 17 2021
%D F. Irschebeck, Einladung zur Zahlentheorie, BI Wissenschaftsverlag 1992, p. 40
%H T. D. Noe, <a href="/A108954/b108954.txt">Table of n, a(n) for n = 1..10000</a>
%H Tsutomu Hashimoto, <a href="http://arxiv.org/abs/0807.3690">On a certain relation between Legendre's conjecture and Bertrand's postulate</a>, arXiv:0807.3690 [math.GM], 2008.
%F a(n) = A000720(2*n)-A000720(n).
%F For n > 1, a(n) = A060715(n). - _David Wasserman_, Nov 04 2005
%F Conjecture: G.f.: Sum_{i>0} Sum_{j>=i|i+j is prime} x^j. - _Benedict W. J. Irwin_, Mar 31 2017
%F From _Wesley Ivan Hurt_, Sep 20 2021: (Start)
%F a(n) = Sum_{k=1..n} A010051(2*n-k+1).
%F a(n) = Sum_{k=n*(n+1)/2+2..(n+1)*(n+2)/2} A010051(A128076(k)). (End)
%p A108954 := proc(n)
%p numtheory[pi](2*n)-numtheory[pi](n) ;
%p end proc: # _R. J. Mathar_, Nov 03 2017
%t Table[Length[Select[Transpose[FactorInteger[Binomial[2 n, n]]][[1]], # > n &]], {n, 100}] (* _T. D. Noe_, Aug 18 2011 *)
%t f[n_] := Length@ Select[ Range[n + 1, 2n], PrimeQ]; Array[f, 100] (* _Robert G. Wilson v_, Mar 20 2012 *)
%t Table[PrimePi[2n]-PrimePi[n],{n,90}] (* _Harvey P. Dale_, Mar 11 2013 *)
%o (PARI) g(n) = for(x=1,n,y=primepi(2*x)-primepi(x);print1(y","))
%o (Python)
%o from sympy import primepi
%o def A108954(n): return primepi(n<<1)-primepi(n) # _Chai Wah Wu_, Aug 19 2024
%Y Cf. A000720, A060715.
%Y Cf. A067434 (number of prime factors in binomial(2*n,n)), A193990, A074990.
%Y Related sequences:
%Y Primes (p) and composites (c): A000040, A002808, A000720, A065855.
%Y Primes between p(n) and 2*p(n): A063124, A070046; between c(n) and 2*c(n): A376761; between n and 2*n: A035250, A060715, A077463, A108954.
%Y Composites between p(n) and 2*p(n): A246514; between c(n) and 2*c(n): A376760; between n and 2*n: A075084, A307912, A307989, A376759.
%K nonn,easy,changed
%O 1,4
%A _Cino Hilliard_, Jul 22 2005