How do you "read" this function? I'm trying to understand a proof in which you have to create an injective function $g:ℕ^ℕ\rightarrowℝ$ ($ℕ^ℕ$ is the set of all function from $ℕ$ to $ℕ$), and my book defines it like this:

I understand (obvoiusly) the part that says $0.101001000..$ but I don't understand the formula for $a_n$. Where it says "for some $k≥1$" does it mean that I have to define $k$ before applying that formula or I have to compute the values changing $k$ over time?
I tried to get the same number they got for the identity function (the $0.10100..$) but I can't see how they got it using the formula:
Using the identity function $i(n)=n$, with $k=2$ the condition "if $n=k+\sum_{i=0}^{k-1}f(i)$ would become $2+f(i(0))+f(i(1))$ but how do i know what values $f(0)$, $f(1)$ etc have?
Could you guys please calculate that number they got using the identity function using that formula?
Thank you!
 A: The sentence "How do I know what values $f(0)$, $f(1)$, etc., have?" shows that there is some misunderstanding around: The $f$ is given to you. It is a "point" with infinitely many coordinates $\bigl(f(0)$, $f(1)$, $f(2)$, $\ldots\bigr) $. You now have to encode this point into a binary string from which all coordinates $f(i)$ can be obtained back later on. It seems that you have understood the idea of the construction as it was demonstrated in the example.
The problem now is to find a "mathematical" description of the construction idea. The given description more or less transfers the idea, but it is assumed that the reader already knows what's going on. I'd do it in the following way: Given $f: \>{\mathbb N}_{\geq0}\to{\mathbb N}_{\geq0}$, define numbers $n_k$ $(k\geq1)$ as follows:
$$n_k:=k+\sum_{i=0}^{k-1}f(i)\qquad(k\geq1)$$ and put
$$a_{n_k}:=1\quad(k\geq1),\qquad a_n=0\quad({\rm otherwise})\ .$$
A: They very likely messed up and used $i$ for two totally different things. e.g. means for example so $i()$ is a simple example for $f()$ but they used $i$ as index and as a function name. Bad people. Replace $i$ when it is used for function name, identity, line 4, 8 and 11 with for example $d$ and read again.
The expression for $a_n$ is unnecessary complicated, adding to a confusion. It just says that there are $f(0)+f(1)+...+f(m)$ zeros plus $m$ $1$'s before each $1$ in the expansion. It is a logical inversion that makes a very simple thing sounds oh so mathematical, which is a practice that you can find in far more serious places. Sorry for the torture.'
$f(0)$,$f(1)$ are the values of one chosen function. So this paragraph explains how to map a function to a real number. It means for any function create this mapping.
