As far as I know, no one has been able to find an onto function $f:\mathbb{N} \rightarrow P$ where $P$ is the set of all primes. Does there exist an onto function $f: \mathbb{N}\times \mathbb{N} \rightarrow P$ where $P$ is the set of all primes? Finally, is there any general onto function $f:\mathbb{N}^k \rightarrow P$, where $k \in \mathbb{N}$? Of course what i want is a closed form that is, something like a formula. Not a function like f(n)= nth prime number.

  • 9
    $\begingroup$ Sure there is an onto function $f:\mathbb N \rightarrow P$. Take for instance $f(n) = p_n$, the $n$th prime. If you want a formula instead, that's a different question. $\endgroup$
    – TonyK
    Sep 29, 2015 at 18:45
  • $\begingroup$ @TonyK obviously I am talking about a function with a close form, something like a formula. $\endgroup$ Sep 30, 2015 at 10:13
  • $\begingroup$ Yes, obviously. But if you are going to ask such questions, it's important that you get the terminology right. $\endgroup$
    – TonyK
    Sep 30, 2015 at 11:58
  • $\begingroup$ @TonyK I apologize for my mistake, yeah I should have said closed form... Sorry.... Yes a open form is what i want..... :) $\endgroup$ Oct 1, 2015 at 9:20
  • 1
    $\begingroup$ Your question is too broad to admit a precise answer (are you only interested in polynomials, or some broader class of "formulas"?), but this might be a good place to do some background reading: en.wikipedia.org/wiki/Formula_for_primes $\endgroup$ Oct 6, 2015 at 17:09


You must log in to answer this question.

Browse other questions tagged .