# Ways of representing numbers

For instance, this:

S=0|P|S+S
P=2^(S)


is the specification for a way of representing any integer. Some generated results:

2^(2^(0+0)+0+0)+2^(0)+0+0+0 = 3
0+0+0+2^(2^(2^(0+2^(0+0+0+0+0+0+0)))) = 16
2^(0) = 1
0+2^(2^(0+0))+2^(2^(0+2^(2^(2^(0)))))+0+0+2^(0)+0+2^(0+0)+2^(2^(2^(0+0+0+2^(2^(0))+2^(2^(0))+0+2^(2^(2^(0+2^(0+0)+2^(2^(2^(0+0+2^(2^(0)))+0+0)))))+0+2^(0)+2^(0)+2^(2^(0+2^(0))))))+2^(2^(2^(2^(2^(0))+0))+2^(0))+0+2^(0) = 196613+2^(2^(2^(10+2^(2^(2^(65537))))))
0 = 0


Then there's my favorite (not counting Church numerals), biquinary, in which decimal digits are represented by exactly two bits on, out of five (so there are 5×4/2=10 possible choices).The bits have numeric values 0, 1, 2, 4, and 7; two of these will add up to any digit 1-9, but the digit 0 is exceptionally represented as 4+7. (Wikipedia uses the name "biquinary" for a different, seven-bit code, but I was taught that it meant the code described in the first article.)

(The point of this strange system is that it has some redundancy in it -- four bits are more than enough for decimal digits -- and in the old days computer memory was prone to failure.)

Interesting!