TITLE: Is the set of all pairs of natural numbers countable?
QUESTION [7 upvotes]: Say that $\Bbb N \times \Bbb N$ is the set of all pairs $(n_1, n_2)$ of natural numbers. Is it countable? My hypothesis is yes it is countable because sets are countable. But I am unable to come up with a proof. Is my hypothesis correct? How is it countable?

REPLY [2 votes]: Another easy way :take a pair, write down the numbers in any numeration basis. For example  (decimal) 1234 and  987. Add extra zeros where needed so they are the same length, and shuffle them
1 2 3 4
 0 9 8 7
--------
10293847

Reverse operation : take digits with even (resp. odd) positions.
EDIT: and of course there are explicit formulas, here given as 3 recursive Python functions
def combine(a,b):
   return 0 if a==0 and b==0 else 10*combine(b/10, a) + (b % 10)
def second(n):
   return 0 if n==0 else 10*second(n/100)+ (n%10)
def first(n):
   return second(n/10)