Nearly there (AYB)

Conceptually, it's solid, but there's a rounding error somewhere for
very large inputs. 99% sure it's in the base conversion, but I'll have
to step through to be positive.