Bijective function from naturals to primes

  • Context: Undergrad 
  • Thread starter Thread starter asmani
  • Start date Start date
  • Tags Tags
    Function Primes
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
9 replies · 2K views
asmani
Messages
104
Reaction score
0
What's the problem with this trivial solution: n --> n'th prime.
 
Physics news on Phys.org
asmani said:
When I googled what I found were mind boggling functions...
Can you give an example?

Your solution does of course use the result that the number of primes is not finite, so depending on what can be assumed known, that solution may not be "trivial".
 
I was thinking about bijection from Q to N. here is what I came up with: m/n --> 2m3n
And it's easy to show there's a bijection from the set "2m3n for all coprime n and m" to N.

Edit: This is Q+ to N. Does it work?
 
Last edited:
Can you give a counterexample?
 
asmani said:
Can you give a counterexample?
The map is into and not onto, e.g. you don't hit any prime greater than three.
 
Oh I see what you mean. Let me clarify: It's a bijection from Q+ to W, and then from W to N, where W is the set of all 2m3n for all coprime n and m.

Here is the bijection from W to N: Map the smallest member of W to 1, the second smallest member of W to 2, and so on
 
This will do, I guess, but then you could as well use the standard diagonalization scheme.
Here's an interesting paper about the repetitions in it:
http://www.cs.utexas.edu/users/sandip/acl2-09/presentations/rationals-talk.pdf