Search All of the Math Forum:

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

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

 Messages: [ Previous | Next ]
 Peter Percival Posts: 1,492 Registered: 10/25/10
Re: Is there a polynomial time algorithm for enumerating prime
numbers?

Posted: Jun 5, 2012 10:54 AM

On Tue, 05 Jun 2012 12:05:59 +0100, Timothy Murphy <gayleard@eircom.net>
wrote:

> 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: http://www.opera.com/mail/

Date Subject Author
6/5/12 Peter Percival
6/5/12 Pubkeybreaker
6/5/12 Peter Percival
6/5/12 Pubkeybreaker
6/5/12 quasi
6/6/12 Brian Q. Hutchings
6/5/12 gnasher729
6/5/12 Pubkeybreaker
6/5/12 Timothy Murphy
6/5/12 Peter Percival
6/6/12 Graham Cooper