Is the set of sequences of natural numbers with trailing zeros countable?
On the one hand concatenation of the finite sequence produces a set that is a subset of the natural numbers. On the other hand, while Cantor's diagonal argument fails to produce a sequence with trailing zeros (at the same time not on the list)--I was wondering if there is a way to salvage the diagonal argument?
Solution 1:
The set of finite sequences of natural numbers is countable. In fact you can enumerate them by first listing all sequences with at most $n$ non-zero elements which are all less than $n$ for $n=1,2,\dots$...
The Cantor diagonal argument then must fail, and in fact it fails because when you modify a sequence with trailing zero you obtain an infinite sequence.
Solution 2:
You cannot salvage the diagonal argument because the set is in fact countable.
Let $k_n$ be an enumeration of the prime integers, then given a sequence which is eventually zero, $\langle k_n\mid n\in\Bbb N\rangle$ we define: $$\langle k_n\mid n\in\Bbb N\rangle\mapsto\prod_{n\in\Bbb N}p_n^{k_n}-1$$
This map is well-defined because all but finitely many $k_n$ are zero, so the product is really just a finite product of numbers. It is not hard to verify that this is indeed a bijection between the eventually zero sequences, and the natural numbers.