Results 1 to 5 of 5

Math Help - A prime returning function?

  1. #1
    Member mfetch22's Avatar
    Joined
    Feb 2010
    From
    Columbus, Ohio, USA
    Posts
    168

    A prime returning function?

    Is there such a fuction of the form P(n) which returns the nth prime number? The function would be such that:

    P(1) = 2
    P(2) = 3
    P(3) = 5
    P(4) = 7
    P(5) = 11
    .
    .
    .
    .


    I think the idea is clear. Is there such a function? Or reasearch on such a function?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by mfetch22 View Post
    Is there such a fuction of the form P(n) which returns the nth prime number? The function would be such that:

    P(1) = 2
    P(2) = 3
    P(3) = 5
    P(4) = 7
    P(5) = 11
    .
    .
    .
    .


    I think the idea is clear. Is there such a function? Or reasearch on such a function?
    If you don't need to go very high, you could write a sieve. Here's a website that allows you to find the nth prime for n up to 10^{12}.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor chiph588@'s Avatar
    Joined
    Sep 2008
    From
    Champaign, Illinois
    Posts
    1,163
    Quote Originally Posted by mfetch22 View Post
    Is there such a fuction of the form P(n) which returns the nth prime number? The function would be such that:

    P(1) = 2
    P(2) = 3
    P(3) = 5
    P(4) = 7
    P(5) = 11
    .
    .
    .
    .


    I think the idea is clear. Is there such a function? Or reasearch on such a function?
    Formula for primes - Wikipedia, the free encyclopedia

    This is as close as you can get to a true prime number formula.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by chiph588@ View Post
    Formula for primes - Wikipedia, the free encyclopedia

    This is as close as you can get to a true prime number formula.
    That polynomial inequality in 26 variables is trippy! Thanks for the link.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor Bruno J.'s Avatar
    Joined
    Jun 2009
    From
    Canada
    Posts
    1,266
    Thanks
    1
    Awards
    1
    Of much interest is also Riemann's "explicit formula"!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 4
    Last Post: January 1st 2012, 09:25 PM
  2. Function and prime factors
    Posted in the Algebra Forum
    Replies: 2
    Last Post: June 23rd 2011, 02:50 PM
  3. Replies: 1
    Last Post: June 25th 2010, 08:57 PM
  4. Matlab not returning variable as intended
    Posted in the Math Software Forum
    Replies: 7
    Last Post: April 18th 2010, 03:35 PM
  5. Prime counting function
    Posted in the Number Theory Forum
    Replies: 4
    Last Post: June 11th 2006, 02:29 PM

Search Tags


/mathhelpforum @mathhelpforum