Number Representations API
Convert integers and numbers into the special number representations that ordinary base conversion leaves out — and back again. The graycode endpoint converts between an integer and its reflected binary Gray code, where consecutive values differ by exactly one bit (used in rotary encoders, Karnaugh maps and error reduction). The balanced-ternary endpoint converts between an integer and balanced ternary, the base-3 system with digits −1, 0 and +1 (written T, 0, 1) that needs no separate sign. The factoradic endpoint converts between an integer and the factorial number system (mixed radix 1, 2, 3, …), the basis of permutation ranking and Lehmer codes. The continued-fraction endpoint turns a fraction or a real number into its continued-fraction expansion [a0; a1, a2, …] and lists the convergents — the successively best rational approximations — and can rebuild the value from the terms. All integer maths is exact via big integers. Everything is computed locally and deterministically, so it is instant and private. Ideal for computer-science teaching, combinatorics and permutation ranking, error-correcting and encoder design, rational approximation, and recreational mathematics. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 5 endpoints. This handles special number representations; for ordinary base 2-36 conversion use a base-convert API.
api.oanor.com/numrep-api