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.

Showing 1-8 of 8 results.

A000720 pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159...

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 21, 21, 21, 21, 21, 21
Offset: 1

Views

Author

Keywords

Comments

Partial sums of A010051 (characteristic function of primes). - Jeremy Gardiner, Aug 13 2002
pi(n) and prime(n) are inverse functions: a(A000040(n)) = n and A000040(n) is the least number m such that A000040(a(m)) = A000040(n). A000040(a(n)) = n if (and only if) n is prime. - Jonathan Sondow, Dec 27 2004
See the additional references and links mentioned in A143227. - Jonathan Sondow, Aug 03 2008
A lower bound that gets better with larger N is that there are at least T prime numbers less than N, where the recursive function T is: T = N - N*Sum_{i=0..T(sqrt(N))} A005867(i)/A002110(i). - Ben Paul Thurston, Aug 23 2010
Number of partitions of 2n into exactly two parts with the smallest part prime. - Wesley Ivan Hurt, Jul 20 2013
Equivalent to the Riemann hypothesis: abs(a(n) - li(n)) < sqrt(n)*log(n)/(8*Pi), for n >= 2657, where li(n) is the logarithmic integral (Lowell Schoenfeld). - Ilya Gutkovskiy, Jul 05 2016
The second Hardy-Littlewood conjecture, that pi(x) + pi(y) >= pi(x + y) for integers x and y with min{x, y} >= 2, is known to hold for (x, y) sufficiently large (Udrescu 1975). - Peter Luschny, Jan 12 2021

Examples

			There are 3 primes <= 6, namely 2, 3 and 5, so pi(6) = 3.
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, p. 8.
  • Raymond Ayoub, An Introduction to the Analytic Theory of Numbers, Amer. Math. Soc., 1963; p. 129.
  • Florian Cajori, A History of Mathematical Notations, Dover edition (2012), par. 409.
  • Richard Crandall and Carl Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 5.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, Theorems 6, 7, 420.
  • G. J. O. Jameson, The Prime Number Theorem, Camb. Univ. Press, 2003. [See also the review by D. M. Bressoud (link below).]
  • Władysław Narkiewicz, The Development of Prime Number Theory, Springer-Verlag, 2000.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 132-133, 157-184.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Section VII.1. (For inequalities, etc.).
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Gerald Tenenbaum and Michel Mendès France, Prime Numbers and Their Distribution, AMS Providence RI, 1999.
  • V. Udrescu, Some remarks concerning the conjecture pi(x + y) <= pi(x) + pi(y), Rev. Roumaine Math. Pures Appl. 20 (1975), 1201-1208.

Crossrefs

Closely related:
A099802: Number of primes <= 2n.
A060715: Number of primes between n and 2n (exclusive).
A035250: Number of primes between n and 2n (inclusive).
A038107: Number of primes < n^2.
A014085: Number of primes between n^2 and (n+1)^2.
A007053: Number of primes <= 2^n.
A036378: Number of primes p between powers of 2, 2^n < p <= 2^(n+1).
A006880: Number of primes < 10^n.
A006879: Number of primes with n digits.
A033270: Number of odd primes <= n.
A065855: Number of composites <= n.
For lists of large values of a(n) see, e.g., A005669(n) = a(A002386(n)), A214935(n) = a(A205827(n)).
Related sequences:
Primes (p) and composites (c): A000040, A002808, A065855.
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.
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.

Programs

  • Haskell
    a000720 n = a000720_list !! (n-1)
    a000720_list = scanl1 (+) a010051_list  -- Reinhard Zumkeller, Sep 15 2011
    
  • Magma
    [ #PrimesUpTo(n): n in [1..200] ];  // Bruno Berselli, Jul 06 2011
    
  • Maple
    with(numtheory); A000720 := pi; [ seq(A000720(i),i=1..50) ];
  • Mathematica
    A000720[n_] := PrimePi[n]; Table[ A000720[n], {n, 1, 100} ]
    Array[ PrimePi[ # ]&, 100 ]
    Accumulate[Table[Boole[PrimeQ[n]],{n,100}]] (* Harvey P. Dale, Jan 17 2015 *)
  • PARI
    A000720=vector(100,n,omega(n!)) \\ For illustration only; better use A000720=primepi
    
  • PARI
    vector(300,j,primepi(j)) \\ Joerg Arndt, May 09 2008
    
  • Python
    from sympy import primepi
    for n in range(1,100): print(primepi(n), end=', ') # Stefano Spezia, Nov 30 2018
  • Sage
    [prime_pi(n) for n in range(1, 79)]  # Zerinvary Lajos, Jun 06 2009
    

Formula

The prime number theorem gives the asymptotic expression a(n) ~ n/log(n).
For x > 1, pi(x) < (x / log x) * (1 + 3/(2 log x)). For x >= 59, pi(x) > (x / log x) * (1 + 1/(2 log x)). [Rosser and Schoenfeld]
For x >= 355991, pi(x) < (x / log(x)) * (1 + 1/log(x) + 2.51/(log(x))^2 ). For x >= 599, pi(x) > (x / log(x)) * (1 + 1/log(x)). [Dusart]
For x >= 55, x/(log(x) + 2) < pi(x) < x/(log(x) - 4). [Rosser]
For n > 1, A138194(n) <= a(n) <= A138195(n) (Tschebyscheff, 1850). - Reinhard Zumkeller, Mar 04 2008
For n >= 33, a(n) = 1 + Sum_{j=3..n} ((j-2)! - j*floor((j-2)!/j)) (Hardy and Wright); for n >= 1, a(n) = n - 1 + Sum_{j=2..n} (floor((2 - Sum_{i=1..j} (floor(j/i)-floor((j-1)/i)))/j)) (Ruiz and Sondow 2000). - Benoit Cloitre, Aug 31 2003
a(n) = A001221(A000142(n)). - Benoit Cloitre, Jun 03 2005
G.f.: Sum_{p prime} x^p/(1-x) = b(x)/(1-x), where b(x) is the g.f. for A010051. - Franklin T. Adams-Watters, Jun 15 2006
a(n) = A036234(n) - 1. - Jaroslav Krizek, Mar 23 2009
From Enrique Pérez Herrero, Jul 12 2010: (Start)
a(n) = Sum_{i=2..n} floor((i+1)/A000203(i)).
a(n) = Sum_{i=2..n} floor(A000010(n)/(i-1)).
a(n) = Sum_{i=2..n} floor(2/A000005(n)). (End)
Let pf(n) denote the set of prime factors of an integer n. Then a(n) = card(pf(n!/floor(n/2)!)). - Peter Luschny, Mar 13 2011
a(n) = -Sum_{p <= n} mu(p). - Wesley Ivan Hurt, Jan 04 2013
a(n) = (1/2)*Sum_{p <= n} (mu(p)*d(p)*sigma(p)*phi(p)) + sum_{p <= n} p^2. - Wesley Ivan Hurt, Jan 04 2013
a(1) = 0 and then, for all k >= 1, repeat k A001223(k) times. - Jean-Christophe Hervé, Oct 29 2013
a(n) = n/(log(n) - 1 - Sum_{k=1..m} A233824(k)/log(n)^k + O(1/log(n)^{m+1})) for m > 0. - Jonathan Sondow, Dec 19 2013
a(n) = A001221(A003418(n)). - Eric Desbiaux, May 01 2014
a(n) = Sum_{j=2..n} H(-sin^2 (Pi*(Gamma(j)+1)/j)) where H(x) is the Heaviside step function, taking H(0)=1. - Keshav Raghavan, Jun 18 2016
a(A014076(n)) = (1/2) * (A014076(n) + 1) - n + 1. - Christopher Heiling, Mar 03 2017
From Steven Foster Clark, Sep 25 2018: (Start)
a(n) = Sum_{m=1..n} A143519(m) * floor(n/m).
a(n) = Sum_{m=1..n} A001221(m) * A002321(floor(n/m)) where A002321() is the Mertens function.
a(n) = Sum_{m=1..n} |A143519(m)| * A002819(floor(n/m)) where A002819() is the Liouville Lambda summatory function and |x| is the absolute value of x.
a(n) = Sum_{m=1..n} A137851(m)/m * H(floor(n/m)) where H(n) = Sum_{m=1..n} 1/m is the harmonic number function.
a(n) = Sum_{m=1..log_2(n)} A008683(m) * A025528(floor(n^(1/m))) where A008683() is the Moebius mu function and A025528() is the prime-power counting function.
(End)
Sum_{k=2..n} 1/a(k) ~ (1/2) * log(n)^2 + O(log(n)) (de Koninck and Ivić, 1980). - Amiram Eldar, Mar 08 2021
a(n) ~ 1/(n^(1/n)-1). - Thomas Ordowski, Jan 30 2023
a(n) = Sum_{j=2..n} floor(((j - 1)! + 1)/j - floor((j - 1)!/j)) [Mináč, unpublished] (see Ribenboim, pp. 132-133). - Stefano Spezia, Apr 13 2025
a(n) = n - 1 - Sum_{k=2..floor(log_2(n))} pi_k(n), where pi_k(n) is the number of k-almost primes <= n. - Daniel Suteu, Aug 27 2025

Extensions

Additional links contributed by Lekraj Beedassy, Dec 23 2003
Edited by M. F. Hasler, Apr 27 2018 and (links recovered) Dec 21 2018

A006093 a(n) = prime(n) - 1.

Original entry on oeis.org

1, 2, 4, 6, 10, 12, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70, 72, 78, 82, 88, 96, 100, 102, 106, 108, 112, 126, 130, 136, 138, 148, 150, 156, 162, 166, 172, 178, 180, 190, 192, 196, 198, 210, 222, 226, 228, 232, 238, 240, 250, 256, 262, 268, 270
Offset: 1

Views

Author

Keywords

Comments

These are also the numbers that cannot be written as i*j + i + j (i,j >= 1). - Rainer Rosenthal, Jun 24 2001; Henry Bottomley, Jul 06 2002
The values of k for which Sum_{j=0..n} (-1)^j*binomial(k, j)*binomial(k-1-j, n-j)/(j+1) produces an integer for all n such that n < k. Setting k=10 yields [0, 1, 4, 11, 19, 23, 19, 11, 4, 1, 0] for n = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], so 10 is in the sequence. Setting k=3 yields [0, 1, 1/2, 1/2] for n = [-1, 0, 1, 2], so 3 is not in the sequence. - Dug Eichelberger (dug(AT)mit.edu), May 14 2001
n such that x^n + x^(n-1) + x^(n-2) + ... + x + 1 is irreducible. - Robert G. Wilson v, Jun 22 2002
Records for Euler totient function phi.
Together with 0, n such that (n+1) divides (n!+1). - Benoit Cloitre, Aug 20 2002; corrected by Charles R Greathouse IV, Apr 20 2010
n such that phi(n^2) = phi(n^2 + n). - Jon Perry, Feb 19 2004
Numbers having only the trivial perfect partition consisting of a(n) 1's. - Lekraj Beedassy, Jul 23 2006
Numbers n such that the sequence {binomial coefficient C(k,n), k >= n } contains exactly one prime. - Artur Jasinski, Dec 02 2007
Record values of A143201: a(n) = A143201(A001747(n+1)) for n > 1. - Reinhard Zumkeller, Aug 12 2008
From Reinhard Zumkeller, Jul 10 2009: (Start)
The first N terms can be generated by the following sieving process:
start with {1, 2, 3, 4, ..., N - 1, N};
for i := 1 until SQRT(N) do
(if (i is not striked out) then
(for j := 2 * i + 1 step i + 1 until N do
(strike j from the list)));
remaining numbers = {a(n): a(n) <= N}. (End)
a(n) = partial sums of A075526(n-1) = Sum_{1..n} A075526(n-1) = Sum_{1..n} (A008578(n+1) - A008578(n)) = Sum_{1..n} (A158611(n+2) - A158611(n+1)) for n >= 1. - Jaroslav Krizek, Aug 04 2009
A171400(a(n)) = 1 for n <> 2: subsequence of A171401, except for a(2) = 2. - Reinhard Zumkeller, Dec 08 2009
Numerator of (1 - 1/prime(n)). - Juri-Stepan Gerasimov, Jun 05 2010
Numbers n such that A002322(n+1) = n. This statement is stronger than repeating the property of the entries in A002322, because it also says in reciprocity that this sequence here contains no numbers beyond the Carmichael numbers with that property. - Michel Lagneau, Dec 12 2010
a(n) = A192134(A095874(A000040(n))); subsequence of A192133. - Reinhard Zumkeller, Jun 26 2011
prime(a(n)) + prime(k) < prime(a(k) + k) for at least one k <= a(n): A212210(a(n),k) < 0. - Reinhard Zumkeller, May 05 2012
Except for the first term, numbers n such that the sum of first n natural numbers does not divide the product of first n natural numbers; that is, n*(n + 1)/2 does not divide n!. - Jayanta Basu, Apr 24 2013
BigOmega(a(n)) equals BigOmega(a(n)*(a(n) + 1)/2), where BigOmega = A001222. Rationale: BigOmega of the product on the right hand side factorizes as BigOmega(a/2) + Bigomega(a+1) = BigOmega(a/2) + 1 because a/2 and a + 1 are coprime, because BigOmega is additive, and because a + 1 is prime. Furthermore Bigomega(a/2) = Bigomega(a) - 1 because essentially all 'a' are even. - Irina Gerasimova, Jun 06 2013
Record values of A060681. - Omar E. Pol, Oct 26 2013
Deficiency of n-th prime. - Omar E. Pol, Jan 30 2014
Conjecture: All the sums Sum_{k=s..t} 1/a(k) with 1 <= s <= t are pairwise distinct. In general, for any integers d >= -1 and m > 0, if Sum_{k=i..j} 1/(prime(k)+d)^m = Sum_{k=s..t} 1/(prime(k)+d)^m with 0 < i <= j and 0 < s <= t then we must have (i,j) = (s,t), unless d = m = 1 and {(i,j),(s,t)} = {(4,4),(8,10)} or {(4,7),(5,10)}. (Note that 1/(prime(8)+1)+1/(prime(9)+1)+1/(prime(10)+1) = 1/(prime(4)+1) and Sum_{k=5..10} 1/(prime(k)+1) = 1/(prime(4)+1) + Sum_{k=5..7} 1/(prime(k)+1).) - Zhi-Wei Sun, Sep 09 2015
Numbers n such that (prime(i)^n + n) is divisible by (n+1), for all i >= 1, except when prime(i) = n+1. - Richard R. Forberg, Aug 11 2016
a(n) is the period of Fubini numbers (A000670) over the n-th prime. - Federico Provvedi, Nov 28 2020

References

  • Archimedeans Problems Drive, Eureka, 40 (1979), 28.
  • Harvey Dubner, Generalized Fermat primes, J. Recreational Math., 18 (1985): 279-280.
  • M. Gardner, The Colossal Book of Mathematics, pp. 31, W. W. Norton & Co., NY, 2001.
  • M. Gardner, Mathematical Circus, pp. 251-2, Alfred A. Knopf, NY, 1979.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

a(n) = K(n, 1) and A034693(K(n, 1)) = 1 for all n. The subscript n refers to this sequence and K(n, 1) is the index in A034693. - Labos Elemer
Cf. A000040, A034694. Different from A075728.
Complement of A072668 (composite numbers minus 1), A072670(a(n))=0.
Essentially the same as A039915.
Cf. A101301 (partial sums), A005867 (partial products).
Column 1 of the following arrays/triangles: A087738, A249741, A352707, A378979, A379010.
The last diagonal of A162619, and of A174996, the first diagonal in A131424.
Row lengths of irregular triangles A086145, A124223, A212157.

Programs

Formula

a(n) = (p-1)! mod p where p is the n-th prime, by Wilson's theorem. - Jonathan Sondow, Jul 13 2010
a(n) = A000010(prime(n)) = A000010(A006005(n)). - Antti Karttunen, Dec 16 2012
a(n) = A005867(n+1)/A005867(n). - Eric Desbiaux, May 07 2013
a(n) = A000040(n) - 1. - Omar E. Pol, Oct 26 2013
a(n) = A033879(A000040(n)). - Omar E. Pol, Jan 30 2014

Extensions

Correction for change of offset in A158611 and A008578 in Aug 2009 Jaroslav Krizek, Jan 27 2010
Obfuscating comments removed by Joerg Arndt, Mar 11 2010
Edited by Charles R Greathouse IV, Apr 20 2010

A060208 a(n) = 2*pi(n) - pi(2*n), where pi(i) = A000720(i).

Original entry on oeis.org

-1, 0, 1, 0, 2, 1, 2, 2, 1, 0, 2, 1, 3, 3, 2, 1, 3, 3, 4, 4, 3, 2, 4, 3, 3, 3, 2, 2, 4, 3, 4, 4, 4, 3, 3, 2, 3, 3, 3, 2, 4, 3, 5, 5, 4, 4, 6, 6, 5, 5, 4, 3, 5, 4, 3, 3, 2, 2, 4, 4, 6, 6, 6, 5, 5, 4, 6, 6, 5, 4, 6, 6, 8, 8, 7, 6, 6, 6, 7, 7, 7, 6, 8, 7, 7, 7, 6, 6, 8, 7, 6, 6, 6, 6, 6, 5, 6, 6, 5, 4, 6, 6, 8, 8, 8, 7, 9, 9, 11, 11, 11, 10, 12, 11, 10, 10, 9, 9, 9, 8, 7, 7
Offset: 1

Views

Author

Labos Elemer, Mar 19 2001

Keywords

Comments

Rosser & Schoenfeld show 2*pi(x) > pi(2*x) for x > 10. - N. J. A. Sloane, Jul 03 2013, corrected Jul 09 2015

Examples

			n=100, pi(100)=25, pi(200)=46, 2pi(100)-pi(2*100) =4=a(100)
		

References

  • J. Barkley Rosser and Lowell Schoenfeld, Abstracts of Scientific Communications, Internat. Congress Math., Moscow, 1966, Section 3, Theory of Numbers.
  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.
  • Sanford Segal, On Pi(x+y)<=Pi(x)+Pi(y). Transactions American Mathematical Society, 104 (1962), 523-527.

Crossrefs

Programs

  • Magma
    [2*#PrimesUpTo(n) -#PrimesUpTo(2*n): n in [1..200]]; // G. C. Greubel, Aug 01 2024
    
  • Mathematica
    f[n_] := 2 PrimePi[n] - PrimePi[2 n]; Array[f, 122] (* Robert G. Wilson v, Aug 12 2011 *)
  • PARI
    a(n)=2*primepi(n)-primepi(2*n) \\ Charles R Greathouse IV, Jul 02 2013
    
  • SageMath
    [2*prime_pi(n) -prime_pi(2*n) for n in range(1,201)] # G. C. Greubel, Aug 01 2024

Formula

a(n) = Mod[2*PrimePi[n], PrimePi[2n]] = 2*A000720(n) - A000720(2n) for n>1.
a(n) ~ 2n log 2 / (log n)^2, by the prime number theorem. - N. J. A. Sloane, Mar 12 2007
a(n) = -A047886(n,n) (see A212210 to A212213). - Reinhard Zumkeller, Apr 15 2008

Extensions

Edited by N. J. A. Sloane, Jul 03 2013

A212213 Array read by antidiagonals: pi(n) + pi(k) - pi(n+k), where pi() = A000720.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 2, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
Offset: 2

Views

Author

N. J. A. Sloane, May 04 2012

Keywords

Comments

It is conjectured that pi(x) + pi(y) >= pi(x+y) for 1 < y <= x.

Examples

			Array begins:
  0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, ...
  0, 1, 0, 1, 1, 2, 1, 1, 0, 1, 1, ...
  0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, ...
  0, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, ...
  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...
  1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 1, ...
  1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, ...
  ...
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.

Crossrefs

Programs

  • Mathematica
    t[n_, k_] := PrimePi[n] + PrimePi[k] - PrimePi[n + k]; Table[t[n - k + 2, k], {n, 0, 15}, {k, 2, n}] // Flatten (* Jean-François Alcover, Dec 31 2012 *)

A047886 Triangle read by rows: T(n,k) = pi(n+k) - pi(n) - pi(k), where pi() = A000720 (n >= 0, 0 <= k <= n).

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, -1, -1, -2, 0, 1, 0, -1, -1, -1, -1, 0, 0, -1, -2, -1, -2, -1, -2, 0, 0, -1, -1, -1, -1, -1, -2, -2, 0, 0, 0, -1, 0, -1, -1, -2, -1, -1, 0, 1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, -2, -1, -2, -1, -1, -1, -2, 0, 1, 0, -1
Offset: 0

Views

Author

Keywords

Comments

T(n,0)=0; for n > 0: T(n,1)=A010051(n); T(n,n)=-A060208(n). - Reinhard Zumkeller, Apr 15 2008
A212210-A212213 are the preferred versions of this array.

Examples

			Triangle begins
  0;
  0,  1;
  0,  1,  0;
  0,  0,  0, -1;
  0,  1,  0,  0,  0;
  0,  0,  0, -1, -1, -2;
  ...
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[PrimePi[n+k]-PrimePi[n]-PrimePi[k],{n,0,20},{k,0,n}]] (* Harvey P. Dale, Feb 22 2012 *)

Extensions

More terms from James Sellers, Dec 22 1999

A047885 Array a(m,n) = pi(m+n) - pi(m) - pi(n) read by antidiagonals, where pi() = A000720 (m,n >= 0).

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -2, -1, -2, -1, -2, -1, 0, 0
Offset: 0

Views

Author

Keywords

Comments

A212210-A212213 are the preferred versions of this array.

Examples

			Beginning of array is
  0  0  0  0  0  0  0  0 ...
  0  1  1  0  1  0  1  0 ...
  0  1  0  0  0  0 -1 ...
  0  0  0 -1  0 -1 -1 ...
  ...
		

Crossrefs

A212212 Array read by antidiagonals: pi(n) + pi(k) - pi(n+k), where pi() = A000720.

Original entry on oeis.org

-1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 2, 1, 2, 1, 2, 1, 0, -1, 0, 1, 1, 1, 1, 1, 1, 0, -1, 0, 0, 1, 1, 2, 1, 2, 1, 1, 0, 0, -1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, -1, 0, 0, 1, 0, 1, 1, 2, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 0
Offset: 1

Views

Author

N. J. A. Sloane, May 04 2012

Keywords

Comments

It is conjectured that pi(x) + pi(y) >= pi(x+y) for 1 < y <= x.

Examples

			Array begins:
  -1, -1,  0, -1,  0, -1,  0,  0,  0, -1,  0, -1, ...
  -1,  0,  0,  0,  0,  0,  1,  1,  0,  0,  0,  0, ...
   0,  0,  1,  0,  1,  1,  2,  1,  1,  0,  1,  1, ...
  -1,  0,  0,  0,  1,  1,  1,  1,  0,  0,  1,  1, ...
   0,  0,  1,  1,  2,  1,  2,  1,  1,  1,  2,  1, ...
  -1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1, ...
   0,  1,  2,  1,  2,  1,  2,  2,  2,  1,  2,  1, ...
   0,  1,  1,  1,  1,  1,  2,  2,  1,  1,  1,  1, ...
   ...
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.

Crossrefs

Cf. A000720, A212210-A212213, A060208, A047885, A047886. First row and column are -A010051.

Programs

  • Mathematica
    a[n_, k_] := PrimePi[n] + PrimePi[k] - PrimePi[n+k]; Flatten[ Table[a[n-k, k], {n, 1, 15}, {k, 1, n-1}]] (* Jean-François Alcover, Jul 18 2012 *)

A212211 Triangle read by rows: T(n,k) = pi(n) + pi(k) - pi(n+k), n >= 2, 2 <= k <= n, where pi() = A000720().

Original entry on oeis.org

0, 0, 1, 0, 0, 0, 0, 1, 1, 2, 0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 2, 0, 1, 0, 1, 1, 2, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 2, 1, 2, 1, 1, 1, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 2, 2, 3
Offset: 2

Views

Author

N. J. A. Sloane, May 04 2012

Keywords

Comments

It is conjectured that pi(x) + pi(y) >= pi(x+y) for 1 < y <= x.

Examples

			Triangle begins:
  0,
  0, 1,
  0, 0, 0,
  0, 1, 1, 2,
  0, 1, 1, 1, 1,
  1, 2, 1, 2, 1, 2,
  1, 1, 1, 1, 1, 2, 2,
  0, 1, 0, 1, 1, 2, 1, 1,
  0, 0, 0, 1, 1, 1, 1, 0, 0,
  0, 1, 1, 2, 1, 2, 1, 1, 1, 2,
  0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
  ...
		

References

  • D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, Section VII.5, p. 235.

Crossrefs

Programs

  • Haskell
    a212211 n k = a212211_tabl !! (n-2) !! (k-2)
    a212211_tabl = map a212211_row [2..]
    a212211_row n = zipWith (-)
       (map (+ a000720 n) $ take (n - 1) $ tail a000720_list)
       (drop (n + 1) a000720_list)
    -- Reinhard Zumkeller, May 04 2012
  • Mathematica
    t[n_, k_] := PrimePi[n] + PrimePi[k] - PrimePi[n+k]; Flatten[ Table[t[n, k], {n, 2, 13}, {k, 2, n}]] (* Jean-François Alcover, May 21 2012 *)
Showing 1-8 of 8 results.