(Translated by https://www.hiragana.jp/)
The On-Line Encyclopedia of Integer Sequences (OEIS)
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)
#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

#388 by Navvye Anand at Sun May 19 07:18:41 EDT 2024
MATHEMATICA

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

STATUS

approved

editing

Discussion
Sun May 19
07:21
Navvye Anand: Faster way of counting the number of primes less than or equal to n. https://ibb.co/JHT4XXJ.
#387 by Andrey Zabolotskiy at Fri Mar 22 07:32:49 EDT 2024
STATUS

editing

approved

#386 by Andrey Zabolotskiy at Fri Mar 22 07:32:46 EDT 2024
FORMULA

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

STATUS

approved

editing

#385 by Peter Luschny at Tue Sep 05 04:25:49 EDT 2023
STATUS

editing

approved