in reply to Finding the next larger prime.

Okay. I found what I remembered. It is the Consequence Two of the Prime Number Theorem.

If I interpret this correctly, which is a big IF, then given that you know a prime and its position then the theorum provides a way of calculating a set of bounds within which the next prime will be located which reduces the search area considerably.

There are various refinements which reduce the search space further with the most recent being

In 1986 Te Riele showed there are more than 10180 successive integers x for which pi(x)>Li(x) between 6.62.10370 and 6.69.10370

However, what the hell the number? "6.62.10" is?, raised to any damn power, I haven't a clue :)


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!

Replies are listed 'Best First'.
Re: Re: Finding the next larger prime.
by davis (Vicar) on Oct 30, 2003 at 09:26 UTC

    <guess type="wild">
    6.62.10370 could be 6.62*10370 - multiplication is sometimes written as a dot in the centre of the line, so it could have been a transcribing error
    </guess>


    davis
    It's not easy to juggle a pregnant wife and a troubled child, but somehow I managed to fit in eight hours of TV a day.

      Agreed. Once you notice that the digits after the last '.' are always 10, the realisation dawns, but it meant absolutely nothing when I first saw it. It's a very strange way to right exponential numbers.

      It could equally as well mean 6 * 62.10370!


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      Hooray!

        Not really. It could be parsed that way, but it can't be lexed that way, not in the given context.

        ------
        We are the carpenters and bricklayers of the Information Age.

        The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

        ... strings and arrays will suffice. As they are easily available as native data types in any sane language, ... - blokhead, speaking on evolutionary algorithms

        Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Re^2: Finding the next larger prime. (conclusions)
by tye (Sage) on Oct 30, 2003 at 16:55 UTC
    If I interpret this correctly [...] the theorum provides a way of calculating a set of bounds within which the next prime will be located which reduces the search area considerably

    Your conclusion is dead wrong but I don't think it is due to a problem of interpretation. (:

    You could use the theorem to restrict the search area for the next prime but it would be much more useful to use other techniques to restrict the search area:

    1. Assume the next prime after some prime (P) is larger than P. In fact, you should probably start looking at P+2 unless P is 2 (in which case you simply return 3 without performing any calculations).
    2. Assume the next prime after P doesn't have a prime between P and it. That is, start looking close to P and stop looking when you find a prime.

    That is, if you used the theorem to find the lower bound of where to search, it would return a value quite a bit below P so using the (obvious) lower limit of P will be a much better choice. And finding an upper bound of where to search is of no use since it will be too high to make sense to start looking there and starting on the low end means we know we will find a prime (the one we are looking for) before we get to the upper bound (or else we'd have proved the theorem incorrect).

                    - tye

      So, what your saying (if I interpret you correctly:), is that despite all of the revisions and improvements made to the Prime Number Theorum, the margin for error for the lower bound for a given prime P will always be greater than the distance between P and P-1?

      If so, its a shame none of the reference material I read actually states that minor caveat! Or maybe they did, but not in a way that I understood.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail
      Hooray!

        I assume the articles didn't bother to state that because it isn't particularly relavent to what they are discussing and they probably consider it obvious. (:

        Of course the bounds are not accurate to a "distance" of around 1 or 2! No such bound can ever be more accurate than the "after P try P+2" idea (or else it would be incorrect) or even equally as accurate (or else it would be exact and constitute a closed formula for computing primes).

        Ah! Perhaps you aren't aware that...

        No matter how large of numbers you deal with, you can find (P such that) P and P+2 that are both prime and you can find arbitrarily large D such that (there is a P where) P and P+D are adjacent primes (as I recall, the proofs of these aren't even very complicated, involving N! with +1 and/or -1 inserted here and there).

        That is, even extremely large adjacent primes can be as close together as 2 or very far apart. The theorems you've been reading put bounds on how big you have to make P before you can get D to be a desired size.

        (updated)

                        - tye