[0-9a-zA-Z]* string expressed with primes or prime-factorization-style way to break it into parts?
- by HH
Suppose a string consists of numbers and alphabets. You want to break it into parts, an analogy is primes' factorization, but how can you do similar thing with strings [0-9a-zA-Z]* or even with arbitrary strings? I could express it in alphabets and such things with octal values and then prime-factorize it but then I need to keep track of places where I had the non-numbers things. Is there some simple way to do it? I am looking for simple succinct solutions and don't want too much side-effects.
[Update] mvds has the correct idea, to change the base, how would you implement it?