I was trying to find a direct proof that $|\mathbb N^{\mathbb N}| = |2^\mathbb N|$, by finding a bijection between the two sets. The idea that came to mind was to start with the sequence of natural numbers. Each natural number would be 'translated' in a sequence of zeroes of the length given by the natural number. A 1 would be added to the sequence obtained, and all the 01 sequences thus obtained would be concatenated in the order dictated by the original sequence of naturals. However, this would run into problems, since all complete 01 sequences thus obtained would end on 1, so that the function from $\mathbb N^{\mathbb N}$ to $2^\mathbb N$ would not be surjective.
I turned to Stack Exchange for advice and found out that the post Cardinality of the set of all natural sequences is $2^{\aleph_0}$ contained the same solution, except that ones were switched for zeroes and vice versa. Of course, this could not work either: all 01 sequences obtained end on 0.
As a workaround to the problem, I would propose the function as described above, except that the last natural number in the original series would now be translated in its binary form, and no 0 or 1 added. I think that would result in a bijection. Could that be right? Would there be other possibilities?
Edit: I am now convinced that the approach I proposed cannot work either. The function is not injective. At first I thought that the last part of the 01 sequence corresponding to the last natural number of the original sequence would be identifiable by its starting with 11 (one 1 stemming from the previous number, the other from the binary form of the last natural in the sequence - except when that would be 0). I now realize that 11 may occur within the binary form itself. Therefore, still at a loss...