Jan 1, 1970January 1st, 1970 · 1 minute read · tweet
The unexpected complexity of list letter markers
Using math to solve the x, y, z, aa, ab, ac... problem.
All indexes are zero-based.
- = input index.
- = size of the collection of available symbols (e.g.
a, b, c, ..., z
). - = digit position from the right.
- = index of the symbol in the collection.
For the domain: ,
we can describe the algorithm with the function:
,
where: .
is the "digit offset", which compensates for two things:
- Zero-based input index ().
- Leading undefined values ().