[go: up one dir, main page]

login
Revision History for A000720 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
pi(n), the number of primes <= n. Sometimes called PrimePi(n) to distinguish it from the number 3.14159...
(history; published version)
#398 by N. J. A. Sloane at Tue Oct 22 02:52:20 EDT 2024
STATUS

editing

approved

#397 by N. J. A. Sloane at Tue Oct 22 02:52:17 EDT 2024
CROSSREFS

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.

STATUS

approved

editing

#396 by N. J. A. Sloane at Thu Oct 17 21:25:31 EDT 2024
STATUS

editing

approved

#395 by N. J. A. Sloane at Thu Oct 17 21:25:26 EDT 2024
CROSSREFS

Closely related:

Cf. A099802: Number of primes <= 2n.

Cf. A060715: Number of primes between n and 2n (exclusive).

Cf. A035250: Number of primes between n and 2n (inclusive).

Cf. A038107: Number of primes < n^2.

Cf. A014085: Number of primes between n^2 and (n+1)^2.

Cf. A007053: Number of primes <= 2^n.

Cf. A036378: Number of primes p between powers of 2, 2^n < p <= 2^(n+1).

Cf. A006880: Number of primes < 10^n.

Cf. A006879: Number of primes with n digits.

Cf. A033270: Number of odd primes <= n.

A065855: Number of composites <= n.

STATUS

approved

editing

#394 by R. J. Mathar at Sat Aug 03 12:28:31 EDT 2024
STATUS

editing

approved

#393 by R. J. Mathar at Sat Aug 03 12:28:21 EDT 2024
LINKS

Bent E. Petersen, <a href="https://www.math.ucdavis.edu/~tracy/courses/math205A/PNT_Petersen.pdf">Prime Number Theorem</a>, Seminar Lecture Note, 1996; <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.502.4684&amp;rep=rep1&amp;type=pdf/118ddc1708154d5a7d5aaf28b9527c33f0ee5b69">version 2002-05-14</a>.

STATUS

approved

editing

#392 by Stefano Spezia at Sun May 19 11:56:06 EDT 2024
MATHEMATICA

PrimePiOptimized[n_] := Count[Range[2, n], _?PrimeQ] (* Navvye Anand, May 19 2024 *)

KEYWORD

nonn,core,easy,nice,changed

STATUS

proposed

approved

#391 by Michel Marcus at Sun May 19 07:24:23 EDT 2024
STATUS

editing

proposed

Discussion
Sun May 19
08:56
Amiram Eldar: I am getting 0.015625 for Timing[Array[PrimePi[#] &, 3000];] and 2.234375 for PrimePiOptimized[n_] := Count[Range[2, n], _?PrimeQ]; Timing[Array[PrimePiOptimized, 3000];], i.e., your code is 100 times slower.
09:01
Navvye Anand: That's weird, for me it's showing the opposite, as shown in https://ibb.co/JHT4XXJ. Could you try AbsoluteTiming?
09:08
Amiram Eldar: Try 10000: With PrimePi you don't wait. Then try with PrimePiOptimized and see for yourself.
11:55
Stefano Spezia: Trying 100000 your code is about 300 slower. I will revert your change
#390 by Michel Marcus at Sun May 19 07:23:19 EDT 2024
MATHEMATICA

PrimePiOptimized[n_] := Count[Range[2, n], _?PrimeQ] (* Navvye Anand, May 19, 2024 *)

STATUS

proposed

editing

Discussion
Sun May 19
07:24
Michel Marcus: no comma in the date ; next time please use (* ~~~~ *) to sign , as explained in the stylesheet
#389 by Navvye Anand at Sun May 19 07:21:25 EDT 2024
STATUS

editing

proposed