home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!gatech!darwin.sura.net!wupost!waikato.ac.nz!bill
- From: bill@waikato.ac.nz
- Newsgroups: sci.math
- Subject: Re: Primes
- Message-ID: <1992Aug18.091619.10152@waikato.ac.nz>
- Date: 18 Aug 92 09:16:19 +1200
- References: <9208171021.aa01492@Paris.ics.uci.edu>
- Organization: University of Waikato, Hamilton, New Zealand
- Lines: 52
-
- In article <9208171021.aa01492@Paris.ics.uci.edu>, kibler@turing.ICS.UCI.EDU (Dennis Kibler) writes:
- > In mathematica the number of primes less than n or equal to n
- > is given by PrimePi[n].
- >
- > The following took about 1 second to compute.
- >
- >
- >
- > Do[Print[i," ",PrimePi[2^i]],{i,30}]
- > 1 1
- > 2 2
- > 3 4
- > 4 6
- > 5 11
- > 6 18
- > 7 31
- > 8 54
- > 9 97
- > 10 172
- > 11 309
- > 12 564
- > 13 1028
- > 14 1900
- > 15 3512
- > 16 6542
- > 17 12251
- > 18 23000
- > 19 43390
- > 20 82025
- > 21 155611
- > 22 295947
- > 23 564163
- > 24 1077871
- > 25 2063689
- > 26 3957809
- > 27 7603553
- > 28 14630843
- > 29 28192750
- > 30 54400028
- >
-
- Does anyone know how Mathematica stores its table of primes, and how efficient
- it is in terms of space and access time? What's the minimum space a table
- of primes can be compressed into if constant access time to find the nth prime
- is required?
-
- Bill Teahan,
- Systems Programmer,
- University of Waikato,
- Hamilton, New Zealand.
- "I have never been lost, but I will admit to being confused for several weeks."
- -- Daniel Boone.
-