home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / sci / math / 10340 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  1.3 KB

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