I think I am looking for a very basic lexicographic ordering concept/function/algorithm, but I'm stumped. Basically, it has to produce the following mapping:
f(0) = a
f(1) = b
...
f(25) = z
f(26) = aa
f(27) = ab
...
f(??) = zz
f(??) = aaa
I think what makes this difficult is that a != aa, in the sense that the symbol a is 0 when it is alone, but when going higher it is not anymore. For example, 26 is 10 in base 26. To contrast, the function I am looking for would return "aa" in that case. So it kind of assigns a to 1 if it is in the most significant position, and a to 0 if it's in a less significant position, if that makes sense... I guess I got to this reasoning by trying to implement f as a conversion into base26, but that doesn't work out, since it starts skipping a's then (because, why would you write 00001, in that case you leave out the zeroes. Also, so when you get to z, and increment it, it increments to ab, and skips aa, because z = za in base26).
So I guess, to rephrase, I am looking for a bijection with type $\mathbb{N}\rightarrow\{a, \cdots,z\}+$, i.e., from the naturals to all words formed of symbols a to z. Is there such a function, and maybe even an efficient/simple implementation? It would also be great to have the inverse of that function, if it exists.