# Binary numbers without the zeros

Every positive integer has a unique representation using a form of base-2 place-value notation (that is, the digits represent 1's, 2's, 4's, 8's, etc just as in binary notation) but where the digits are 1 and 2 rather than 0 and 1:

1 2 11 12 21 22 111 112 121 122 211 ...

These same digit strings in the same ordering can also be interpreted as the ternary numbers that don't have any 0 digits. The successor to a number is computed by finding the lowest-order non-two digit, incrementing it, and resetting all the lower-order 2's back to 1's. This differs from ternary, where the successor would reset all the lower-order 2's to 0's.

It's also easy to add these numbers directly, by the standard right-to-left method with carries. Each carry is 0, 1, or 2; in each digit, we compute the sum of the two given digits and the previous carry, write down 1 if the sum is even and 2 if it is odd, and carry half the remaining amount.

ETA: Via OEIS I find "A number system without a zero" (Foster, Math. Mag. 1947) which does the same sort of thing in decimal.

ETA2: For what this is good for, see this more recent post.