I need to find a function to enumerate the ordered list of sequential words based on a charset. Let me give you an example.
If the charset is "abc", the function to be found "f" should compute the following:
f(0) = a
f(1) = b
f(2) = c
f(3) = aa
f(4) = ab
f(5) = ac
f(6) = ba
f(7) = bb
f(8) = bb
f(9) = ca
f(10) = cb
f(11) = cc
f(12) = aaa
...
It is important to note that "aaa" is different from "aa" or "aaaa". This is why I found it difficult to represent abc as a number system to the base 3.
I am looking for an explicit definition of f(n) to compute f for an arbitrary n without enumerating recursively.
Your function is a version of bijective numeration. In particular, your $f(n)$ is the ($n+1$)th word in the shortlex ordering of all words on the given alphabet. (The $n+1$ is due to your omission of the empty word.) Here's an implementation (in Sage), which is essentially the algorithm given on the page at the first link above, adapted to use an arbitrary $k$-character alphabet rather than the usual digits {1, 2, ..., $k$}:
Here's an implementation of the inverse of that function:
For example
produces