Re: Try to calculate

From: Tom St Denis (tomstdenis_at_iahu.ca)
Date: 05/29/03


Date: Thu, 29 May 2003 03:16:49 GMT


????? wrote:
> I tried to calculate the number of primes of 512 bit long. Hope
> someone may verify the result.
> According to Gauss's prime number theorem, the number of primes less
> than n should be n/ln(n).
> 2^512/ln(2^512) - 2^511/ln(2^511) = ?
> Using my PC's Calculator got 1.885305082130081660668523138413e+151,
> Really big. Somthing you cannot store in any computer.

Um? yea, you can't store 2^503 or so primes in memory, but yes you can
store the number 2^503 in memory. For the record 2^503 ==

26187124863169134960105517574620793217733136368344518315866330944769\
07037123739643906616073860723325720709347302048056807373805236708314\
4426628220715008

[Not particularly hard to calculate :-), you can do it by hand with
about 8 squarings and 7 multiplications in under an hour or so].

Tom



Relevant Pages

  • Re: hash table idea good or no good?
    ... It unsigned long is 32 bits and the primes I listed are much smaller ... You want to use strings as the key. ... You want to store strings, but you use the entire string as one big ... least common multiple scheme used above. ...
    (comp.programming)
  • Re: Prime lists and Computation
    ... > Q2 Is their a complete list of primes to X Published? ... sufficient storage is available to store them all. ... prime lists for trial division. ... of digits by 3 would double the factoring time. ...
    (sci.math)
  • Re: Length of sequence of consecutive primes starting at 2
    ... >> If you mean that you are looking for a list of ALL primes below ... it is another to store and publish it. ... M41 has over 6 million. ... and in the latter with 6 million digit primes. ...
    (sci.math)
  • Re: Calaulation problem
    ... so where is the problem of relevance? ... others as an array of primes. ... guess and store each number in the way that seemed best at the time. ... Also that will only work for integers, you will never find any primes ...
    (microsoft.public.vb.general.discussion)
  • Re: Next prime algorithm
    ... If you are dealing with simple 32 bit unsigned integers/longs, ... I can compute the next 1000 primes for n in the ... If you can store primes <= sqrtyou can even eliminate many of the ... store them as constants in your algorithm code. ...
    (comp.lang.cpp)