cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A108954 a(n) = pi(2*n) - pi(n). Number of primes in the interval (n,2n].

This page as a plain text file.
%I A108954 #54 Apr 21 2025 11:26:37
%S A108954 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 A108954 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 A108954 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 A108954 a(n) = pi(2*n) - pi(n). Number of primes in the interval (n,2n].
%C A108954 a(n) < log(4)*n/log(n) < 7*n/(5*log(n)) for n > 1. - _Reinhard Zumkeller_, Mar 04 2008
%C A108954 Bertrand's postulate is equivalent to the formula a(n) >= 1 for all positive integers n. - _Jonathan Vos Post_, Jul 30 2008
%C A108954 Number of distinct prime factors > n of binomial(2*n,n). - _T. D. Noe_, Aug 18 2011
%C A108954 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 A108954 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 A108954 F. Irschebeck, Einladung zur Zahlentheorie, BI Wissenschaftsverlag 1992, p. 40.
%D A108954 Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 181-182.
%H A108954 T. D. Noe, <a href="/A108954/b108954.txt">Table of n, a(n) for n = 1..10000</a>
%H A108954 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 A108954 a(n) = A000720(2*n)-A000720(n).
%F A108954 For n > 1, a(n) = A060715(n). - _David Wasserman_, Nov 04 2005
%F A108954 Conjecture: G.f.: Sum_{i>0} Sum_{j>=i|i+j is prime} x^j. - _Benedict W. J. Irwin_, Mar 31 2017
%F A108954 From _Wesley Ivan Hurt_, Sep 20 2021: (Start)
%F A108954 a(n) = Sum_{k=1..n} A010051(2*n-k+1).
%F A108954 a(n) = Sum_{k=n*(n+1)/2+2..(n+1)*(n+2)/2} A010051(A128076(k)). (End)
%p A108954 A108954 := proc(n)
%p A108954     numtheory[pi](2*n)-numtheory[pi](n) ;
%p A108954 end proc: # _R. J. Mathar_, Nov 03 2017
%t A108954 Table[Length[Select[Transpose[FactorInteger[Binomial[2 n, n]]][[1]], # > n &]], {n, 100}] (* _T. D. Noe_, Aug 18 2011 *)
%t A108954 f[n_] := Length@ Select[ Range[n + 1, 2n], PrimeQ]; Array[f, 100] (* _Robert G. Wilson v_, Mar 20 2012 *)
%t A108954 Table[PrimePi[2n]-PrimePi[n],{n,90}] (* _Harvey P. Dale_, Mar 11 2013 *)
%o A108954 (PARI) g(n) = for(x=1,n,y=primepi(2*x)-primepi(x);print1(y","))
%o A108954 (Python)
%o A108954 from sympy import primepi
%o A108954 def A108954(n): return primepi(n<<1)-primepi(n) # _Chai Wah Wu_, Aug 19 2024
%Y A108954 Cf. A000720, A060715.
%Y A108954 Cf. A067434 (number of prime factors in binomial(2*n,n)), A193990, A074990.
%Y A108954 Related sequences:
%Y A108954 Primes (p) and composites (c): A000040, A002808, A000720, A065855.
%Y A108954 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 A108954 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 A108954 nonn,easy
%O A108954 1,4
%A A108954 _Cino Hilliard_, Jul 22 2005