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-10 of 233 results. Next

A057752 Difference between nearest integer to Li(10^n) and pi(10^n), where Li(x) = integral of log(x) and pi(10^n) = number of primes <= 10^n (A006880).

Original entry on oeis.org

2, 5, 10, 17, 38, 130, 339, 754, 1701, 3104, 11588, 38263, 108971, 314890, 1052619, 3214632, 7956589, 21949555, 99877775, 222744644, 597394254, 1932355208, 7250186216, 17146907278, 55160980939, 155891678121, 508666658006, 1427745660374, 4551193622464
Offset: 1

Views

Author

Robert G. Wilson v, Oct 30 2000

Keywords

Comments

On his prime pages C. K. Caldwell remarks: "However in 1914 Littlewood proved that pi(x)-Li(x) assumes both positive and negative values infinitely often". - Frank Ellermann, May 31 2003

References

  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus, an imprint of Springer-Verlag, NY, 1995, page 146.
  • Marcus du Sautoy, The Music of the Primes, Fourth Estate / HarperCollins, 2003; see table on p. 90.

Crossrefs

Programs

  • Mathematica
    Table[Round[LogIntegral[10^n] - PrimePi[10^n]], {n, 1, 13}]
  • PARI
    A057752=vector(#A006880,i,round(-eint1(-log(10^i))-A006880[i])) \\ M. F. Hasler, Feb 26 2008
    
  • Python
    from sympy import N, li, primepi, floor
    def round(n):
        return int(floor(n+0.5))
    def A057752(n):
        return round(N(li(10**n),10*n)) - primepi(10**n) # Chai Wah Wu, Apr 30 2018

Extensions

More terms from Frank Ellermann, May 31 2003
The value of a(23) is not known at present, I believe. - N. J. A. Sloane, Mar 17 2008
Name corrected and extended for last two terms a(23) and a(24), with Pi(10^n) for n=23 and 24 from A006880, by Vladimir Pletser, Mar 10 2013
a(25)-a(27) added, using data from A006880, by Chai Wah Wu, Apr 30 2018
a(28) added, using data from A006880, by Eduard Roure Perdices, Apr 14 2021
a(29) added, using data from A006880, by Reza K Ghazi, May 10 2022

A223167 Difference between nearest integer to (Li(10^n)-Li(3)) and pi(10^n), where Li(10^n)-Li(3) = integral(3.. 10^n, dt/log(t)) (A223166) and pi(10^n) = number of primes <= 10^n (A006880).

Original entry on oeis.org

0, 3, 7, 15, 36, 127, 337, 752, 1699, 3101, 11585, 38261, 108969, 314888, 1052616, 3214630, 7956587, 21949553, 99877773, 222744641, 597394252, 1932355206, 7250186214, 17146907276, 55160980937, 155891678119, 508666658004, 1427745660372
Offset: 1

Views

Author

Vladimir Pletser, Mar 16 2013

Keywords

Comments

As Li(3)= 2.163588..., A057752(n)-a(n) = 2, except for n =3, 6, 10, 11, 15, 20 where A057752(n)-a(n)= 3.
This sequence yields an even better average relative difference than Gauss's approximation (A106313), i.e., Average(a(n)/pi(10^n)) = 7.4969...*10^-3 for 1<=n<=24, compared to Average(A057752(n)/pi(10^n)) = 3.2486...*10^-2 and Average(A106313(n)/pi(10^n)) = 2.0116...*10^-2, showing that, when using the logarithmic integral, Li(10^n)-Li(3) (A223166) gives a better approximation to pi(10^n) than Li(10^n)-Li(2) (A190802) and than Li(10^n) (A057754).

Crossrefs

Programs

  • Mathematica
    a[n_] := Round[LogIntegral[10^n] - LogIntegral[3]] - PrimePi[10^n]; Table[a[n], {n, 1, 14}]
  • PARI
    a(n)=round(eint1(-log(3))-eint1(-n*log(10)))-primepi(10^n) \\ Charles R Greathouse IV, May 03 2013

Formula

a(n) = A223166(n) - A006880(n).

Extensions

Terms a(25)-a(28) obtained using A006880. - Eduard Roure Perdices, Apr 14 2021

A221205 a(n) is the nearest integer to sqrt(pi(10^n)) (see A006880).

Original entry on oeis.org

0, 2, 5, 13, 35, 98, 280, 815, 2400, 7131, 21332, 64172, 193928, 588273, 1790235, 5463018, 16710426, 51220671, 157289397, 483795067, 1490241458, 4596440959, 14193917243, 43878472986, 135777758736, 420530985064, 1303551591182, 4043817556078, 12553456467283, 38996129419652
Offset: 0

Views

Author

Vladimir Pletser, Jan 04 2013

Keywords

Comments

Nearest integer to sqrt(pi(10^n)) where pi(10^n) is the number of primes < 10^n (A006880).

Crossrefs

Cf. A006880.

Programs

  • Mathematica
    Array[Round@ Sqrt@ PrimePi[10^#] &, 17, 0] (* Michael De Vlieger, Mar 19 2021 *)
  • PARI
    a(n) = round(sqrt(primepi(10^n))); \\ Michel Marcus, Mar 19 2021
    
  • Python
    from math import isqrt
    from sympy import primepi
    def A221205(n): return (m:=isqrt(k:=int(primepi(10**n))))+int(k-m*(m+1)>=1) # Chai Wah Wu, Jul 31 2022

Formula

a(n) = round(sqrt(A006880(n))).

Extensions

a(21) to a(24) added by Vladimir Pletser, Feb 27 2013 (recovered by Georg Fischer, Jan 20 2019)
a(25)-a(28), obtained using A006880, added by Eduard Roure Perdices, Apr 16 2021
a(29), obtained using A006880, added by Chai Wah Wu, Jul 31 2022

A225138 Difference between pi(10^n) and nearest integer to (4*((S(n))^(n-1))) where pi(10^n) = number of primes <= 10^n (A006880) and S(n) = Sum_{i=0..2} (C(i)*(log(log(A*(B+n^(8/3)))))^(2i)) (A225137).

Original entry on oeis.org

0, 0, 0, 1, 0, -31, -35, 193, 0, -13318, -153006, -828603, 957634, 86210559, 1293461717, 13497122460, 107995231864, 586760026575, -1942949, -54073500144915, -897247302459084, -9393904607181950, -54876701507521387, 379565456321952448
Offset: 1

Views

Author

Vladimir Pletser, Apr 29 2013

Keywords

Comments

A225137 provides exactly the values of pi(10^n) for n = 1, 2, 3, 5 and 9 and yields an average relative difference in absolute value, i.e., average(abs(A225138(n))/pi(10^n)) = 7.2165...*10^-5 for 1 <= n <= 24.
A225137 provides a better approximation to the distribution of pi(10^n) than: (1) the Riemann function R(10^n), whether as the sequence of integers <= R(10^n) (A215663), which yields 1.453...*10^-4, or as the sequence of integers nearest to R(10^n) (A057794), which yields 0.01219...; (2) the functions of the logarithmic integral Li(x) = Integral_{t=0..x} dt/log(t), whether as the sequence of integers nearest to (Li(10^n) - Li(3)) (A223166), which yields 7.4969...x10^-3 (see A223167), or as Gauss's approximation to pi(10^n), i.e., the sequence of integers nearest to (Li(10^n) - Li(2)) (A190802) = 0.020116... (see A106313), or as the sequence of integers nearest to Li(10^n) (A057752), which yields 0.032486....

References

  • Jonathan Borwein, David H. Bailey, Mathematics by Experiment, A. K. Peters, 2004, p. 65 (Table 2.2).
  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus, an imprint of Springer-Verlag, NY, 1996, page 144.

Crossrefs

Formula

a(n) = A006880(n) - A225137(n).

A227694 Difference between pi(10^n) and nearest integer to (F[2n+1](S(n)))^2 where pi(10^n) = number of primes <= 10^n (A006880), F[2n+1](x) are Fibonacci polynomials of odd indices [2n+1] and S(n) = Sum_{i=0..2} (C(i)*(log(log(A*(B+n^2))))^(2i)) (see A227693).

Original entry on oeis.org

0, 0, 0, 0, -3, -29, 171, 2325, 13809, 33409, -443988, -8663889, -99916944, -927360109, -7318034084, -47993181878, -223530657736, 810207694, 16558446000251, 257071298610935, 2657469557986545, 18804132783879606, 24113768300809752, -2232929440358147845, -54971510676262602742
Offset: 1

Views

Author

Vladimir Pletser, Jul 19 2013

Keywords

Comments

A227693 provides exactly the values of pi(10^n) for n = 1 to 4 and yields an average relative difference in absolute value, average(abs(A227694(n))/pi(10^n)) = 1.58269...*10^-4 for 1 <= n <= 25.
A227693 provides a better approximation to the distribution of pi(10^n) than: (1) the Riemann function R(10^n) as the sequence of integers nearest to R(10^n) (A057794), which yields 0.01219...; (2) the functions of the logarithmic integral Li(x) = Integral_{t=0..x} dt/log(t), whether as the sequence of integers nearest to (Li(10^n) - Li(3)) (A223166), which yields 0.0074969... (see A223167), or as Gauss's approximation to pi(10^n), i.e., the sequence of integers nearest to (Li(10^n) - Li(2)) (A190802), which yields 0.020116... (see A106313), or as the sequence of integer nearest to Li(10^n) (A057752), which yields 0.032486....

References

  • Jonathan Borwein, David H. Bailey, Mathematics by Experiment, A. K. Peters, 2004, p. 65 (Table 2.2).
  • John H. Conway and R. K. Guy, The Book of Numbers, Copernicus, an imprint of Springer-Verlag, NY, 1996, page 144.

Crossrefs

Formula

a(n) = A006880(n) - A227693(n).

A135377 Smallest n-primeval prime, i.e., minimal prime number containing all A006880(n) primes < 10^n embedded in it as permutations of some of its substrings.

Original entry on oeis.org

2357, 1123465789, 10112233445566788997, 100111222333444555666777998889, 1000111222233334444555666777798889899, 100001111222233333444445555566666777778888999989
Offset: 1

Views

Author

Lekraj Beedassy, Dec 09 2007

Keywords

Comments

a(1) - a(4) were computed by Mike Keith in 2008 and a(4) - a(31) by Jérôme STORTI in 2002.

Examples

			Mike Keith's website uses a shorthand notation for these numbers. The 4-primeval prime 100111222333444555666777998889 is written in this notation as (1) 2 3 3 3 3 3 3 3 0 998889. The (1) represents the leading 1 digit (which will always be present). The next number says how many consecutive 0's follow the leading 1 and the next says how many consecutive 1's follow that and so on up to the number of consecutive 8's. The final grouping explicitly shows how the last group of 8's and 9's are arranged.
The following are the n-primeval primes as found by _Jérôme STORTI_ in this notation:
5 (1) 3 3 4 4 4 3 3 4 0 98889899
6 (1) 4 4 4 5 5 5 5 5 4 999989
7 (1) 5 5 5 6 5 5 5 6 3 98899999
8 (1) 5 6 7 7 6 7 7 7 6 98999999
9 (1) 7 7 8 8 8 7 8 8 6 9999989899
10 (1) 8 8 8 9 9 9 9 9 7 9999899999
11 (1) 8 9 10 10 10 9 10 10 6 9889989999999
12 (1) 10 10 10 11 11 11 10 11 9 9998999999899
13 (1) 10 11 11 12 11 12 11 12 9 99899999999899
14 (1) 11 13 13 13 12 12 12 13 11 989999989999999
15 (1) 12 13 14 14 13 14 13 14 12 9999999988999999
16 (1) 13 14 14 15 14 14 14 15 12 99999999999999889
17 (1) 14 15 15 16 15 15 15 16 14 998999999999998999
18 (1) 16 17 17 17 16 17 17 17 14 9989999999999899999
19 (1) 17 18 17 18 17 17 17 18 15 988999999899999999999
20 (1) 17 19 18 19 19 18 19 19 16 999999998999999999989
21 (1) 18 19 19 20 19 19 20 20 17 9899999999999999998999
22 (1) 18 20 20 21 20 21 21 21 18 99998999999999999998999
23 (1) 21 23 21 22 21 21 22 22 19 999999889999999999999999
24 (1) 20 22 22 23 22 22 22 23 21 999999999999999989999999
25 (1) 23 23 23 24 23 23 23 24 22 9999999999999999998999999
26 (1) 23 24 24 25 25 25 24 25 22 999999999999999999899999989
27 (1) 24 25 25 26 25 25 25 26 23 9999999998999999999999998999
28 (1) 25 26 27 27 27 26 27 27 25 9999899999999999999999999999
29 (1) 25 27 27 28 27 27 27 28 25 999999989999999999999999999989
30 (1) 26 29 28 29 29 28 28 29 27 999999999999998999999999999999
31 (1) 28 29 29 30 29 29 29 30 27 99999889999999999999999999999999
a(2) = 1123465789 because this is the smallest prime out of which each of the first 25 primes below 10^2, viz. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 can be formed using its digits.
		

Crossrefs

Extensions

Link fixed by Charles R Greathouse IV, Aug 13 2009

A000040 The prime numbers.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271
Offset: 1

Views

Author

Keywords

Comments

See A065091 for comments, formulas etc. concerning only odd primes. For all information concerning prime powers, see A000961. For contributions concerning "almost primes" see A002808.
A number p is prime if (and only if) it is greater than 1 and has no positive divisors except 1 and p.
A natural number is prime if and only if it has exactly two (positive) divisors.
A prime has exactly one proper positive divisor, 1.
The paper by Kaoru Motose starts as follows: "Let q be a prime divisor of a Mersenne number 2^p-1 where p is prime. Then p is the order of 2 (mod q). Thus p is a divisor of q - 1 and q > p. This shows that there exist infinitely many prime numbers." - Pieter Moree, Oct 14 2004
1 is not a prime, for if the primes included 1, then the factorization of a natural number n into a product of primes would not be unique, since n = n*1.
Prime(n) and pi(n) are inverse functions: A000720(a(n)) = n and a(n) is the least number m such that a(A000720(m)) = a(n). a(A000720(n)) = n if (and only if) n is prime.
Second sequence ever computed by electronic computer, on EDSAC, May 09 1949 (see Renwick link). - Russ Cox, Apr 20 2006
Every prime p > 3 is a linear combination of previous primes prime(n) with nonzero coefficients c(n) and |c(n)| < prime(n). - Amarnath Murthy, Franklin T. Adams-Watters and Joshua Zucker, May 17 2006; clarified by Chayim Lowen, Jul 17 2015
The Greek transliteration of 'Prime Number' is 'Protos Arithmos'. - Daniel Forgues, May 08 2009 [Edited by Petros Hadjicostas, Nov 18 2019]
A number n is prime if and only if it is different from zero and different from a unit and each multiple of n decomposes into factors such that n divides at least one of the factors. This applies equally to the integers (where a prime has exactly four divisors (the definition of divisors is relaxed such that they can be negative)) and the positive integers (where a prime has exactly two distinct divisors). - Peter Luschny, Oct 09 2012
Motivated by his conjecture on representations of integers by alternating sums of consecutive primes, for any positive integer n, Zhi-Wei Sun conjectured that the polynomial P_n(x) = Sum_{k=0..n} a(k+1)*x^k is irreducible over the field of rational numbers with the Galois group S_n, and moreover P_n(x) is irreducible mod a(m) for some m <= n(n+1)/2. It seems that no known criterion on irreducibility of polynomials implies this conjecture. - Zhi-Wei Sun, Mar 23 2013
Questions on a(2n) and Ramanujan primes are in A233739. - Jonathan Sondow, Dec 16 2013
From Hieronymus Fischer, Apr 02 2014: (Start)
Natural numbers such that there is exactly one base b such that the base-b alternate digital sum is 0 (see A239707).
Equivalently: Numbers p > 1 such that b = p-1 is the only base >= 1 for which the base-b alternate digital sum is 0.
Equivalently: Numbers p > 1 such that the base-b alternate digital sum is <> 0 for all bases 1 <= b < p-1. (End)
An integer n > 1 is a prime if and only if it is not the sum of positive integers in arithmetic progression with common difference 2. - Jean-Christophe Hervé, Jun 01 2014
Conjecture: Numbers having prime factors <= prime(n+1) are {k|k^f(n) mod primorial(n)=1}, where f(n) = lcm(prime(i)-1, i=1..n) = A058254(n) and primorial(n) = A002110(n). For example, numbers with no prime divisor <= prime(7) = 17 are {k|k^60 mod 30030=1}. - Gary Detlefs, Jun 07 2014
Cramer conjecture prime(n+1) - prime(n) < C log^2 prime(n) is equivalent to the inequality (log prime(n+1)/log prime(n))^n < e^C, as n tend to infinity, where C is an absolute constant. - Thomas Ordowski, Oct 06 2014
I conjecture that for any positive rational number r there are finitely many primes q_1,...,q_k such that r = Sum_{j=1..k} 1/(q_j-1). For example, 2 = 1/(2-1) + 1/(3-1) + 1/(5-1) + 1/(7-1) + 1/(13-1) with 2, 3, 5, 7 and 13 all prime, 1/7 = 1/(13-1) + 1/(29-1) + 1/(43-1) with 13, 29 and 43 all prime, and 5/7 = 1/(3-1) + 1/(7-1) + 1/(31-1) + 1/(71-1) with 3, 7, 31 and 71 all prime. - Zhi-Wei Sun, Sep 09 2015
I also conjecture that for any positive rational number r there are finitely many primes p_1,...,p_k such that r = Sum_{j=1..k} 1/(p_j+1). For example, 1 = 1/(2+1) + 1/(3+1) + 1/(5+1) + 1/(7+1) + 1/(11+1) + 1/(23+1) with 2, 3, 5, 7, 11 and 23 all prime, and 10/11 = 1/(2+1) + 1/(3+1) + 1/(5+1) + 1/(7+1) + 1/(43+1) + 1/(131+1) + 1/(263+1) with 2, 3, 5, 7, 43, 131 and 263 all prime. - Zhi-Wei Sun, Sep 13 2015
Numbers k such that ((k-2)!!)^2 == +-1 (mod k). - Thomas Ordowski, Aug 27 2016
Does not satisfy Benford's law [Diaconis, 1977; Cohen-Katz, 1984; Berger-Hill, 2017]. - N. J. A. Sloane, Feb 07 2017
Prime numbers are the integer roots of 1 - sin(Pi*Gamma(s)/s)/sin(Pi/s). - Peter Luschny, Feb 23 2018
Conjecture: log log a(n+1) - log log a(n) < 1/n. - Thomas Ordowski, Feb 17 2023

Examples

			From _David A. Corneth_, Oct 22 2024: (Start)
7 is a prime number as it has exactly two divisors, 1 and 7.
8 is not a prime number as it does not have exactly two divisors (it has 1, 2, 4 and 8 as divisors though it is sufficient to find one other divisor than 1 and 8)
55 is not a prime number as it does not have exactly two divisors. One other divisor than 1 and 55 is 5.
59 is a prime number as it has exactly two divisors; 1 and 59. (End)
		

References

  • M. Aigner and G. M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 2nd. ed., 2001; see p. 3.
  • T. M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 2.
  • E. Bach and Jeffrey Shallit, Algorithmic Number Theory, I, Chaps. 8, 9.
  • D. M. Bressoud, Factorization and Primality Testing, Springer-Verlag NY 1989.
  • M. Cipolla, "La determinazione asintotica dell'n-mo numero primo.", Rend. d. R. Acc. di sc. fis. e mat. di Napoli, s. 3, VIII (1902), pp. 132-166.
  • John H. Conway and Richard K. Guy, The Book of Numbers, New York: Springer-Verlag, 1996. See pp. 127-149.
  • R. Crandall and C. Pomerance, Prime Numbers: A Computational Perspective, Springer, NY, 2001; see p. 1.
  • Martin Davis, "Algorithms, Equations, and Logic", pp. 4-15 of S. Barry Cooper and Andrew Hodges, Eds., "The Once and Future Turing: Computing the World", Cambridge 2016.
  • J.-P. Delahaye, Merveilleux nombres premiers, Pour la Science-Belin Paris, 2000.
  • J.-P. Delahaye, Savoir si un nombre est premier: facile, Pour La Science, 303(1) 2003, pp. 98-102.
  • M. Dietzfelbinger, Primality Testing in Polynomial Time, Springer NY 2004.
  • M. du Sautoy, The Music of the Primes, Fourth Estate / HarperCollins, 2003; see p. 5.
  • J. Elie, "L'algorithme AKS", in 'Quadrature', No. 60, pp. 22-32, 2006 EDP-sciences, Les Ulis (France);
  • W. & F. Ellison, Prime Numbers, Hermann Paris 1985
  • T. Estermann, Introduction to Modern Prime Number Theory, Camb. Univ. Press, 1969.
  • J. M. Gandhi, Formulae for the nth prime. Proc. Washington State Univ. Conf. on Number Theory, 96-106. Wash. St. Univ., Pullman, Wash., 1971.
  • Jan Gullberg, Mathematics from the Birth of Numbers, W. W. Norton & Co., NY & London, 1997, §3.2 Prime Numbers, pp. 77-78.
  • R. K. Guy, Unsolved Problems Number Theory, Section A.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 2.
  • Peter Hilton and Jean Pedersen, A Mathematical Tapestry: Demonstrating the Beautiful Unity of Mathematics, Cambridge University Press, 2010, pp. (260-264).
  • H. D. Huskey, Derrick Henry Lehmer [1905-1991]. IEEE Ann. Hist. Comput. 17 (1995), no. 2, 64-68. Math. Rev. 96b:01035, cf. http://www.ams.org/mathscinet-getitem?mr=1336709
  • M. N. Huxley, The Distribution of Prime Numbers, Oxford Univ. Press, 1972.
  • D. S. Jandu, Prime Numbers And Factorization, Infinite Bandwidth Publishing, N. Hollywood CA 2007.
  • E. Landau, Handbuch der Lehre von der Verteilung der Primzahlen, Chelsea, NY, 1974.
  • D. H. Lehmer, The sieve problem for all-purpose computers. Math. Tables and Other Aids to Computation, Math. Tables and Other Aids to Computation, 7, (1953). 6-14. Math. Rev. 14:691e
  • D. N. Lehmer, "List of Prime Numbers from 1 to 10,006,721", Carnegie Institute, Washington, D.C. 1909.
  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, Chap. 6.
  • H. Lifchitz, Table des nombres premiers de 0 à 20 millions (Tomes I & II), Albert Blanchard, Paris 1971.
  • R. F. Lukes, C. D. Patterson and H. C. Williams, Numerical sieving devices: their history and some applications. Nieuw Arch. Wisk. (4) 13 (1995), no. 1, 113-139. Math. Rev. 96m:11082, cf http://www.ams.org/mathscinet-getitem?mr=96m:11082
  • P. Ribenboim, The New Book of Prime Number Records, Springer-Verlag NY 1995.
  • P. Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004.
  • H. Riesel, Prime Numbers and Computer Methods for Factorization, Birkhäuser Boston, Cambridge MA 1994.
  • B. Rittaud, "31415879. Ce nombre est-il premier?" ['Is this number prime?'], La Recherche, Vol. 361, pp. 70-73, Feb 15 2003, Paris.
  • D. Shanks, Solved and Unsolved Problems in Number Theory, 2nd. ed., Chelsea, 1978, Chap. 1.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 107-119.
  • D. Wells, Prime Numbers: The Most Mysterious Figures In Math, J. Wiley NY 2005.
  • H. C. Williams and Jeffrey Shallit, Factoring integers before computers. Mathematics of Computation 1943-1993: a half-century of computational mathematics (Vancouver, BC, 1993), 481-531, Proc. Sympos. Appl. Math., 48, AMS, Providence, RI, 1994. Math. Rev. 95m:11143

Crossrefs

For is_prime and next_prime, see A010051 and A151800.
Cf. A000720 ("pi"), A001223 (differences between primes), A002476, A002808, A003627, A006879, A006880, A008578, A080339, A233588.
Cf. primes in lexicographic order: A210757, A210758, A210759, A210760, A210761.
Cf. A003558, A179480 (relating to the Quasi-order theorem of Hilton and Pedersen).
Boustrophedon transforms: A000747, A000732, A230953.
a(2n) = A104272(n) - A233739(n).
Related sequences:
Primes (p) and composites (c): A002808, A000720, 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

  • GAP
    A000040:=Filtered([1..10^5],IsPrime); # Muniru A Asiru, Sep 04 2017
    
  • Haskell
    -- See also Haskell Wiki Link.
    import Data.List (genericIndex)
    a000040 n = genericIndex a000040_list (n - 1)
    a000040_list = base ++ larger where
    base = [2,3,5,7,11,13,17]
    larger = p : filter prime more
    prime n = all ((> 0) . mod n) $ takeWhile (\x -> x*x <= n) larger
    _ : p : more = roll $ makeWheels base
    roll (Wheel n rs) = [n * k + r | k <- [0..], r <- rs]
    makeWheels = foldl nextSize (Wheel 1 [1])
    nextSize (Wheel size bs) p = Wheel (size * p)
    [r | k <- [0..p-1], b <- bs, let r = size*k+b, mod r p > 0]
    data Wheel = Wheel Integer [Integer]
    -- Reinhard Zumkeller, Apr 07 2014
    
  • Magma
    [n : n in [2..500] | IsPrime(n)];
    
  • Magma
    a := func< n | NthPrime(n) >;
    
  • Maple
    A000040 := n->ithprime(n); [ seq(ithprime(i),i=1..100) ];
    # For illustration purposes only:
    isPrime := s -> is(1 = sin(Pi*GAMMA(s)/s)/sin(Pi/s)):
    select(isPrime, [$2..100]); # Peter Luschny, Feb 23 2018
  • Mathematica
    Prime[Range[60]]
  • Maxima
    A000040(n) := block(
    if n = 1 then return(2),
    return( next_prime(A000040(n-1)))
    )$ /* recursive, to be replaced if possible - R. J. Mathar, Feb 27 2012 */
    
  • PARI
    {a(n) = if( n<1, 0, prime(n))};
    
  • PARI
    /* The following functions provide asymptotic approximations, one based on the asymptotic formula cited above (slight overestimate for n > 10^8), the other one based on pi(x) ~ li(x) = Ei(log(x)) (slight underestimate): */
    prime1(n)=n*(log(n)+log(log(n))-1+(log(log(n))-2)/log(n)-((log(log(n))-6)*log(log(n))+11)/log(n)^2/2)
    prime2(n)=solve(X=n*log(n)/2,2*n*log(n),real(eint1(-log(X)))+n)
    \\ M. F. Hasler, Oct 21 2013
    
  • PARI
    forprime(p=2, 10^3, print1(p, ", ")) \\ Felix Fröhlich, Jun 30 2014
    
  • PARI
    primes(10^5) \\ Altug Alkan, Mar 26 2018
    
  • Python
    from sympy import primerange
    print(list(primerange(2, 272))) # Michael S. Branicky, Apr 30 2022
  • Sage
    a = sloane.A000040
    a.list(58)  # Jaap Spies, 2007
    
  • Sage
    prime_range(1, 300)  # Zerinvary Lajos, May 27 2009
    

Formula

The prime number theorem is the statement that a(n) ~ n * log n as n -> infinity (Hardy and Wright, page 10).
For n >= 2, n*(log n + log log n - 3/2) < a(n); for n >= 20, a(n) < n*(log n + log log n - 1/2). [Rosser and Schoenfeld]
For all n, a(n) > n log n. [Rosser]
n log(n) + n (log log n - 1) < a(n) < n log n + n log log n for n >= 6. [Dusart, quoted in the Wikipedia article]
a(n) = n log n + n log log n + (n/log n)*(log log n - log n - 2) + O( n (log log n)^2/ (log n)^2). [Cipolla, see also Cesàro or the "Prime number theorem" Wikipedia article for more terms in the expansion]
a(n) = 2 + Sum_{k = 2..floor(2n*log(n)+2)} (1-floor(pi(k)/n)), for n > 1, where the formula for pi(k) is given in A000720 (Ruiz and Sondow 2002). - Jonathan Sondow, Mar 06 2004
I conjecture that Sum_{i>=1} (1/(prime(i)*log(prime(i)))) = Pi/2 = 1.570796327...; Sum_{i=1..100000} (1/(prime(i)*log(prime(i)))) = 1.565585514... It converges very slowly. - Miklos Kristof, Feb 12 2007
The last conjecture has been discussed by the math.research newsgroup recently. The sum, which is greater than Pi/2, is shown in sequence A137245. - T. D. Noe, Jan 13 2009
A000005(a(n)) = 2; A002033(a(n+1)) = 1. - Juri-Stepan Gerasimov, Oct 17 2009
A001222(a(n)) = 1. - Juri-Stepan Gerasimov, Nov 10 2009
From Gary Detlefs, Sep 10 2010: (Start)
Conjecture:
a(n) = {n| n! mod n^2 = n(n-1)}, n <> 4.
a(n) = {n| n!*h(n) mod n = n-1}, n <> 4, where h(n) = Sum_{k=1..n} 1/k. (End)
For n = 1..15, a(n) = p + abs(p-3/2) + 1/2, where p = m + int((m-3)/2), and m = n + int((n-2)/8) + int((n-4)/8). - Timothy Hopper, Oct 23 2010
a(2n) <= A104272(n) - 2 for n > 1, and a(2n) ~ A104272(n) as n -> infinity. - Jonathan Sondow, Dec 16 2013
Conjecture: Sequence = {5 and n <> 5| ( Fibonacci(n) mod n = 1 or Fibonacci(n) mod n = n - 1) and 2^(n-1) mod n = 1}. - Gary Detlefs, May 25 2014
Conjecture: Sequence = {5 and n <> 5| ( Fibonacci(n) mod n = 1 or Fibonacci(n) mod n = n - 1) and 2^(3*n) mod 3*n = 8}. - Gary Detlefs, May 28 2014
Satisfies a(n) = 2*n + Sum_{k=1..(a(n)-1)} cot(k*Pi/a(n))*sin(2*k*n^a(n)*Pi/a(n)). - Ilya Gutkovskiy, Jun 29 2016
Sum_{n>=1} 1/a(n)^s = P(s), where P(s) is the prime zeta function. - Eric W. Weisstein, Nov 08 2016
a(n) = floor(1 - log(-1/2 + Sum_{ d | A002110(n-1) } mu(d)/(2^d-1))/log(2)) where mu(d) = A008683(d) [Ghandi, 1971] (see Ribenboim). Golomb gave a proof in 1974: Give each positive integer a probability of W(n) = 1/2^n, then the probability M(d) of the integer multiple of number d equals 1/(2^d-1). Suppose Q = a(1)*a(2)*...*a(n-1) = A002110(n-1), then the probability of random integers that are mutually prime with Q is Sum_{ d | Q } mu(d)*M(d) = Sum_{ d | Q } mu(d)/(2^d-1) = Sum_{ gcd(m, Q) = 1 } W(m) = 1/2 + 1/2^a(n) + 1/2^a(n+1) + 1/2^a(n+2) + ... So ((Sum_{ d | Q } mu(d)/(2^d-1)) - 1/2)*2^a(n) = 1 + x(n), which means that a(n) is the only integer so that 1 < ((Sum_{ d | Q } mu(d)/(2^d-1)) - 1/2)*2^a(n) < 2. - Jinyuan Wang, Apr 08 2019
Conjecture: n * (log(n)+log(log(n))-1+((log(log(n))-A)/log(n))) is asymptotic to a(n) if and only if A=2. - Alain Rocchelli, Feb 12 2025
From Stefano Spezia, Apr 13 2025: (Start)
a(n) = 1 + Sum_{m=1..2^n} floor(floor(n/Sum_{j=1..m} A080339(j))^(1/n)) [Willans, 1964].
a(n) = 1 + Sum_{m=1..2^n} floor(floor(n/(1 + A000720(m)))^(1/n)) [Willans, 1964]. (End)

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

A007053 Number of primes <= 2^n.

Original entry on oeis.org

0, 1, 2, 4, 6, 11, 18, 31, 54, 97, 172, 309, 564, 1028, 1900, 3512, 6542, 12251, 23000, 43390, 82025, 155611, 295947, 564163, 1077871, 2063689, 3957809, 7603553, 14630843, 28192750, 54400028, 105097565, 203280221, 393615806, 762939111, 1480206279, 2874398515, 5586502348, 10866266172, 21151907950, 41203088796, 80316571436, 156661034233, 305761713237, 597116381732, 1166746786182, 2280998753949, 4461632979717, 8731188863470, 17094432576778, 33483379603407, 65612899915304, 128625503610475
Offset: 0

Views

Author

Keywords

Comments

Conjecture: The number 4 is the only perfect power in this sequence. In other words, it is impossible to have a(n) = x^m for some integers n > 3, m > 1 and x > 1. - Zhi-Wei Sun, Sep 30 2015

Examples

			pi(2^3)=4 since first 4 primes are 2,3,5,7 all <= 2^3 = 8.
		

References

  • Jens Franke et al., pi(10^24), Posting to the Number Theory Mailing List, Jul 29 2010.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    Table[PrimePi[2^n], {n, 0, 46}] (* Robert G. Wilson v *)
  • PARI
    a(n) = primepi(1<John W. Nicholson, May 16 2011

Formula

a(n) = A060967(2n). - R. J. Mathar, Sep 15 2012

Extensions

More terms from Jud McCranie
Extended to n = 52 by Warren D. Smith, Dec 11 2000, computed with Meissel-Lehmer-Legendre inclusion exclusion formula code he wrote back in 1985, recently re-run.
Extended to n = 86 by Douglas B. Staple, Dec 18 2014

A007508 Number of twin prime pairs below 10^n.

Original entry on oeis.org

2, 8, 35, 205, 1224, 8169, 58980, 440312, 3424506, 27412679, 224376048, 1870585220, 15834664872, 135780321665, 1177209242304, 10304195697298, 90948839353159, 808675888577436
Offset: 1

Views

Author

Keywords

Comments

"At the present time (2001), Thomas Nicely has reached pi_2(3*10^15) and his value is confirmed by Pascal Sebah who made a new computation from scratch and up to pi_2(5*10^15) [ = 5357875276068] with an independent implementation."
Though the first paper contributed by D. A. Goldston was reported to be flawed, the more recent one (with other coauthors) maintains and substantiates the result. - Lekraj Beedassy, Aug 19 2005
Theorem. While g is even, g > 0, number of primes p < x (x is an integer) such that p' = p + g is also prime, could be written as qpg(x) = qcc(x) - (x - pi(x) - pi(x + g) + 1) where qcc(x) is the number of "common composite numbers" c <= x such that c and c' = c + g both are composite (see Example below; I propose it here as a theorem only not to repeat for so-called "cousin"-primes (p; p+4), "sexy"-primes (p; p+6), etc.). - Sergey Pavlov, Apr 08 2021

Examples

			For x = 10, qcc(x) = 4 (since 2 is prime; 4, 6, 8, 10 are even, and no odd 0 < d < 25 such that both d and d' = d + 2 are composite), pi(10) = 4, pi(10 + 2) = 5, but, while v = 2+2 or v = 2-2 would be even, we must add 1; hence, a(1) = qcc(10^1) - (10^1 - pi(10^1) - pi(10^1 + 2) + 1) = 4 - (10 - 4 - 5 + 1) = 2 (trivial). - _Sergey Pavlov_, Apr 08 2021
		

References

  • Paulo Ribenboim, The Book of Prime Number Records. Springer-Verlag, NY, 2nd ed., 1989, p. 202.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See p. 195.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001097.
Cf. A173081 and A181678 (number of twin Ramanujan prime pairs below 10^n).

Programs

  • Mathematica
    ile = 2; Do[Do[If[(PrimeQ[2 n - 1]) && (PrimeQ[2 n + 1]), ile = ile + 1], {n, 5*10^m, 5*10^(m + 1)}]; Print[{m, ile}], {m, 0, 7}] (* Artur Jasinski, Oct 24 2011 *)
  • PARI
    a(n)=my(s,p=2);forprime(q=3,10^n,if(q-p==2,s++);p=q);s \\ Charles R Greathouse IV, Mar 21 2013

Formula

Partial sums of A070076(n). - Lekraj Beedassy, Jun 11 2004
For 1 < n < 19, a(n) ~ e * pi(10^n) / (5*n - 5) = e * A006880(n) / (5*n - 5) where e is Napier's constant, see A001113 (probably, so is for any n > 18; we use n > 1 to avoid division by zero). - Sergey Pavlov, Apr 07 2021
For any n, a(n) = qcc(x) - (10^n - pi(10^n) - pi(10^n + 2) + 1) where qcc(x) is the number of "common composite numbers" c <= 10^n such that c and c' = c + 2 both are composite (trivial). - Sergey Pavlov, Apr 08 2021

Extensions

pi2(10^15) due to Nicely and Szymanski, contributed by Eric W. Weisstein
pi2(10^16) due to Pascal Sebah, contributed by Robert G. Wilson v, Aug 22 2002
Added a(17)-a(18) computed by Tomás Oliveira e Silva and link to his web site. - M. F. Hasler, Dec 18 2008
Definition corrected by Max Alekseyev, Oct 25 2010
a(16) corrected by Dana Jacobsen, Mar 28 2014
Showing 1-10 of 233 results. Next