Primes
Does anyone have a list of primes in the range [2, 2^32-1] ? How big is this list?
********
A Problem Worthy of Attack
Proves It''s Worth by Fighting Back
spraff.net: don't laugh, I'm still just starting...
I don''t have a list, but it should be fairly trivial to write a program that''ll build one.
<img src=http://webspace.utexas.edu/~mvdepala/random/resist-ignorance.png
<img src=http://webspace.utexas.edu/~mvdepala/random/resist-ignorance.png
Yeah, it should be quite easy to build a list, although I''m sure you can find one somewhere.
That porgram will have to run for a looong time...

____________________ ____ ___ __ _
Enselic''s Corner - My site. Go test my game Spatra and see if you can beat it onto the Official Spatra Top 10.
CodeSampler.com - Great site with source for specific tasks in DirectX and OpenGL.

____________________ ____ ___ __ _
Enselic''s Corner - My site. Go test my game Spatra and see if you can beat it onto the Official Spatra Top 10.
CodeSampler.com - Great site with source for specific tasks in DirectX and OpenGL.
[s]--------------------------------------------------------[/s]chromecode.com - software with source code
From A comprehensive introduction to prime numbers: (slightly edited)
"Let N(n) be the number of primes less than n. In 1792, Karl Gauss conjectured that N(n) approaches n/(ln n) as n becomes larger and larger." (This was later proved to be true.)
N(2^20) is about 76,000 (reasonably close to the 82,000 mentioned by AP)
N(2^32) is about 194,000,000, so of the order of 740Mb to store them all? Maybe you could compress them onto a CD
Miles
"Let N(n) be the number of primes less than n. In 1792, Karl Gauss conjectured that N(n) approaches n/(ln n) as n becomes larger and larger." (This was later proved to be true.)
N(2^20) is about 76,000 (reasonably close to the 82,000 mentioned by AP)
N(2^32) is about 194,000,000, so of the order of 740Mb to store them all? Maybe you could compress them onto a CD

Miles
May 20, 2003 02:50 PM
quote:
Original post by Enselic
That porgram will have to run for a looong time...
Yes, about 15 minutes. The number of primes appears to be 203280221.
quote:
Original post by Enselic
That porgram will have to run for a looong time...
I think on modern computers, it would only have to run for a matter of minutes. Not exactly a long time per se...
<img src=http://webspace.utexas.edu/~mvdepala/random/resist-ignorance.png
A table that contained all the primes from 1 to 2^32 (minus one doesn''t matter because 2^32 is an even number) would be very long. The symbol for the number of primes less than a number x > 0 is given by the pi function, pi (x).
Like Miles Clapham said, pi (x) log (x) / x approach 1 as x approaches infinity. (i.e., pi (x) ~ x / log x.) A much better approximation is given by the integral (like my integral ?
)
x
§ (1 / log t) dt
2
I believe this is also due to Gauss.
I used simpsons rule with a division of 2^21 and got 203284494 which agrees closely with AP. Use the integral instead of
x / log x,
it is more acuarate.
no wise fish would go anywhere without a porpoise - The Mock Turtle
Like Miles Clapham said, pi (x) log (x) / x approach 1 as x approaches infinity. (i.e., pi (x) ~ x / log x.) A much better approximation is given by the integral (like my integral ?

x
§ (1 / log t) dt
2
I believe this is also due to Gauss.
I used simpsons rule with a division of 2^21 and got 203284494 which agrees closely with AP. Use the integral instead of
x / log x,
it is more acuarate.
no wise fish would go anywhere without a porpoise - The Mock Turtle
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement