Quibbles
- Why isn't (as implied by the totality of your post) your your initial value, 112358, "a bona fide integer?"
- "the fact that a number is divisible by 3 if the sum of digits of that number is divisible by 3."
Sounds good but for us non-mathematicians, please cite an authoritative source.
- Using Base3 numbers on a quantum computer will break your algorithm.
:-)
Seriously, very nice. ++ for "well done."
If you didn't program your executable by toggling in binary, it wasn't really programming!