The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » sci.math.* » sci.math

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Is there a polynomial time algorithm for enumerating prime numbers?
Replies: 10   Last Post: Jun 6, 2012 9:53 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Peter Percival

Posts: 2,623
Registered: 10/25/10
Re: Is there a polynomial time algorithm for enumerating prime

Posted: Jun 5, 2012 10:54 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Tue, 05 Jun 2012 12:05:59 +0100, Timothy Murphy <>

> Peter Percival wrote:

>> Let p_n be the n-th prime number (p_1 = 2, etc). Is there a polynomial
>> P(n), and an algorithm to find p_n in a number of steps* S(n), where
>> S(n)
>> is bounded by P(n)?
>> * A step being what? If I were to write a program to implement such an
>> algorithm, I would take "step" to mean "machine code instruction"; but
>> there might be a better definition not tied to any particular way of
>> implementing algorithms.

> I'm not an expert in this area,
> but I think with your definition of polynomial time
> your problem would be trivially easy.
> Usually polynomial time would mean P(log n) not P(n),

Silly me, I didn't know that!

> since it would be measured in terms of the length of n (as a binary
> digit)
> not in terms of n itself.
> The AKS algorithm shows that one can determine in time P(log n)
> if n is prime or not.

Luckily, Wikipedia knows what the AKS algorithm is!

> We know p_n is roughly n log(n), say p_n < n^2 for n > N.
> So one could go through all the numbers 1,2,3,...,n^2,
> determining if each was prime in time < P(2 log n),
> and this would take time < n^2 P(2 log n).
> I don't know if one could find p_n in polynomial time
> using the usual definition of this.

Thank you.

Using Opera's revolutionary email client:

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.