[doing] math and increment [alphanumerics] without using character increment
can be decomposed into simpler problems: consider your "alphanumerics" integers coded with a mixed base. This would leave conversion from alphanumeric to integer, (math
) operations (increment, count between: difference/subtraction) on integers, and conversion from integer to alphanumeric.
For integer, have a look at LongAdder. For the conversions, you need to keep a sequence of bases to use - I recommend to start from unit/the little end and just use something easily iterable and able to keep (small) integers. Going from alphanumeric to integer, start with zero. For each character, add its value. For a letter, keep the number of different letters (alphabet size, 26 with the Latin alphabet as used now) as the base to use for that place, for a digit the number of different digits (ten, usually). If another character follows, multiply by that base and repeat.
Conversion from integer to alphanumeric would be the usual divide&remainder (using the bases as kept) - with a catch: how do you handle a carry from the most significant position?
There are some rules though, like some 000 or 666 should not come in a series. That can be done later on
and will kill math
.