Archive for August 19, 2005

My Prime Number Calculator Stats

I forgot to give the execution statistics for my prime number calculator a few weeks ago. Err, that is, if anyone cares… But here it goes:

antilog # of Primes Total Calculations Runtime in Seconds
------- ----------- ------------------ ------------------
      8   5,761,455      1,931,722,630             172.60
      7     664,579        276,809,518               8.11
      6      78,498         13,005,901                .45
      5       9,592            654,029            *~0.005
      4       1,229             34,983           *~0.0003
      3         168              1,970          *~0.00002
      2          25                107        *~0.0000008
      1           4                  3       *~0.00000003

The * would indicate that it’s so small the time calculator can’t precisely count how long it took. The “calculations required” is the minimal I can achieve. That is the deciding factor (along with the type of arithmetic operations used) in the speed of the whole execution.

My algorithms are pretty efficient, but aren’t completely optimized. If anyone whose dad or mom is a computer scientist can give me some advice, feel free to :P I certainly am happy I beat my dad’s program that took 4 hours to calculate up to log(x) = 5.

x would be the number up to which the prime numbers were calculated… And if you remember, the default base of a logarithmic function is ten… so… log(100,000) is log(1 x 10^5), which equals 5. Right? Good. Concept review :P

Comments (2)