What is a base?
Using "place value" a number is formed from a small number of
symbols, 0, 1, 2, etc. up to one less than the "base". In the
base 10 number system, which is our standard system, the symbols range from 0 to
9. To write "10", we use the 1 again, and move it one place to
the left, so it has a "place value" of 10.
The smallest base that is in ordinary use is 2. In this system, called
the "binary" system, the only symbols that are used are 0 and 1.
The place value increases as you move left not by powers of 10, but by powers of
2. So 102 = 2, 1002 = 4, 10002 = 8, etc.
Adding in other bases
The rules of addition in other bases are similar to those for base 10, but
you have to "think in the base" you are using. That means, for
example, if you are using base 7, you have to remember that 4+5=12, so you write
the "2" and carry the "1".
Non-integer bases
Though very foreign to our ordinary way of thinking, there's nothing in
theory that prevents a number base from being a number other than an integer, or
even irrational.
The golden ratio,
represented by the Greek letter, φ (phi), is equal to (sqrt(5)+1)/2.
This number makes a very interesting base because of this special property:
φ2 = φ + 1, which means 100φ = 011φ and
0200φ = 1001φ. These two rules can be
applied in either direction against any sequence of consecutive digits in a
base-φ number to put it in "standard form", which means no
digits other than 0 or 1, and no two 1's in a row. In addition, the
repeating decimal 0.101010... is equal to 1.
100φ = 011φ
This relation can be applied anywhere in a base-φ number to handle most
"carries" when adding. So, for example,
111.111
+111.111
--------
222.222
is the result after doing the addition, but the "2" digits in the
result aren't considered "normal form", so they must be reorganized
into zeros and ones by "carrying" the digits to the left. Unlike
integer base arithmetic, in which digits need to be carried only to the next
column, in base-φ, we have to carry two non-zero digits two places to the
left using the identity 100φ = 011φ.
Here's how that looks:
111.111
+111.111
--------
222.222, and then process the "carries" this way:
222.311
223.201
232.101
321.101
1211.101
10111.101
0200φ = 1001φ
Does this always work? No, we have a problem if we encounter an
"02" pattern. One way to handle it is to carry one digit
to the left, and one digit two places to the right, so 02.00 becomes
10.01. Then we might have another problem if the "rightbound
carry" lands on a digit that's already one, because we might have to carry
a digit two more places to the right. Here's an example where this comes
up:
10100
+10101
--------
20201, and then process the "carries" this way:
21002
21010.01
110010.01
"Standard Form" of a number, base φ
In standard form, an integer has only 1's and 0's, and no two 1's are
consecutive.
In addition, the repeating decimal, 0101010... should be eliminated by
rewriting it as 1. To understand why 1 = φ-1+φ-3+φ-5+...,
read this:
let s = φ-1+φ-3+φ-5+...
then φ2s = φ+φ-1+φ-3+φ-5+...
so (φ2-1)s = φ, and since φ2-1 = φ, it follows that
s=1.
The "greedy algorithm" for converting a positive integer, n, starts
with the highest power of φ that doesn't exceed n, writing a "1"
in that place, and continuing down until the number, base φ, is exactly
equal to n. Note that using the greedy algorithm, there will never be two
consecutive 1's, because the greedy algorithm would have chosen a 1 in the place
to the left of the two 1's.
1. To convert an integer x to a base-φ number, note that x = (x + 0φ).
2. Subtract the highest power of φ, which is still smaller than the number we have, to get
our new number, and record a "1" in the appropriate place in the resulting base-φ number.
3. Unless our number is 0, go to step 2.
4. Finished.
The "least greedy" algorithm is strikingly similar to the greedy
algorithm. In this algorithm, a 1 isn't placed in the number unless
absolutely necessary. It's only necessary to put a 1 into the number if
011111... would not be large enough. The number 011111... is φ
times 100000..., so this is the criterion for deciding whether to write a
1. The least greedy algorithm works this way:
1. To convert an integer x to a base-φ number, using the least greedy
algorithm,
2. Find the highest power of φ, which is still smaller than the number we have,
and subtract the next-higher power of φ to get out new number, and record a "1" in the appropriate place in the resulting base-φ number.
3. Unless our number is 0, go to step 2.
4. Finished.
This algorithm, as written, will never finish, because all integers coded
with the "least greedy" algorithm end in a never ending sequence of
101010...
Table of integers in base φ
| n |
n, base φ (greedy algorithm) -- A105424 |
n, base φ (least greedy algorithm) -- A118240 |
| 1 | 1 | 0.101010... |
| 2 | 10.01 | 1.101010... |
| 3 | 100.01 | 10.11101010... |
| 4 | 101.01 | 11.11101010... |
| 5 | 1000.1001 | 101.11101010... |
| 6 | 1010.0001 | 111.01101010... |
| 7 | 10000.0001 | 1010.1011101010... |
| 8 | 10001.0001 | 1011.1011101010... |
| 9 | 10010.0101 | 1101.1011101010... |
| 10 | 10100.0101 | 1110.1111101010... |
| 11 | 10101.0101 | 1111.1111101010... |
| 12 | 100000.101001 | 10101.1111101010... |
| 13 | 100010.001001 | 10111.0111101010... |
| 14 | 100100.001001 | 11010.1101101010... |
| 15 | 100101.001001 | 11011.1101101010... |
| 16 | 101000.100001 | 11101.1101101010... |
| 17 | 101010.000001 | 11111.0101101010... |
| 18 | 1000000.000001 | 101010.101011101010... |
| 19 | 1000001.000001 | 101011.101011101010... |
| 20 | 1000010.010001 | 101101.101011101010... |
| 21 | 1000100.010001 | 101110.111011101010... |
| 22 | 1000101.010001 | 101111.111011101010... |
| 23 | 1001000.100101 | 110101.111011101010... |
| 24 | 1001010.000101 | 110111.011011101010... |
| 25 | 1010000.000101 | 111010.101111101010... |
| 26 | 1010001.000101 | 111011.101111101010... |
| 27 | 1010010.010101 | 111101.101111101010... |
| 28 | 1010100.010101 | 111110.111111101010... |
| 29 | 1010101.010101 | 111111.111111101010... |
| 30 | 10000000.10101001 | 1010101.111111101010... |
| 31 | 10000010.00101001 | 1010111.011111101010... |
| 32 | 10000100.00101001 | 1011010.110111101010... |
| 33 | 10000101.00101001 | 1011011.110111101010... |
| 34 | 10001000.10001001 | 1011101.110111101010... |
| 35 | 10001010.00001001 | 1011111.010111101010... |
| 36 | 10010000.00001001 | 1101010.101101101010... |
| 37 | 10010001.00001001 | 1101011.101101101010... |
| 38 | 10010010.01001001 | 1101101.101101101010... |
| 39 | 10010100.01001001 | 1101110.111101101010... |
| 40 | 10010101.01001001 | 1101111.111101101010... |
| 41 | 10100000.10100001 | 1110101.111101101010... |
| 42 | 10100010.00100001 | 1110111.011101101010... |
| 43 | 10100100.00100001 | 1111010.110101101010... |
| 44 | 10100101.00100001 | 1111011.110101101010... |
| 45 | 10101000.10000001 | 1111101.110101101010... |
| 46 | 10101010.00000001 | 1111111.010101101010... |
| 47 | 100000000.00000001 | 10101010.10101011101010... |
| 48 | 100000001.00000001 | 10101011.10101011101010... |
| 49 | 100000010.01000001 | 10101101.10101011101010... |
| 50 | 100000100.01000001 | 10101110.11101011101010... |
| 51 | 100000101.01000001 | 10101111.11101011101010... |
| 52 | 100001000.10010001 | 10110101.11101011101010... |
| 53 | 100001010.00010001 | 10110111.01101011101010... |
| 54 | 100010000.00010001 | 10111010.10111011101010... |
| 55 | 100010001.00010001 | 10111011.10111011101010... |
| 56 | 100010010.01010001 | 10111101.10111011101010... |
| 57 | 100010100.01010001 | 10111110.11111011101010... |
| 58 | 100010101.01010001 | 10111111.11111011101010... |
| 59 | 100100000.10100101 | 11010101.11111011101010... |
| 60 | 100100010.00100101 | 11010111.01111011101010... |
| 61 | 100100100.00100101 | 11011010.11011011101010... |
| 62 | 100100101.00100101 | 11011011.11011011101010... |
| 63 | 100101000.10000101 | 11011101.11011011101010... |
| 64 | 100101010.00000101 | 11011111.01011011101010... |
| 65 | 101000000.00000101 | 11101010.10101111101010... |
| 66 | 101000001.00000101 | 11101011.10101111101010... |
| 67 | 101000010.01000101 | 11101101.10101111101010... |
| 68 | 101000100.01000101 | 11101110.11101111101010... |
| 69 | 101000101.01000101 | 11101111.11101111101010... |
| 70 | 101001000.10010101 | 11110101.11101111101010... |
| 71 | 101001010.00010101 | 11110111.01101111101010... |
| 72 | 101010000.00010101 | 11111010.10111111101010... |
| 73 | 101010001.00010101 | 11111011.10111111101010... |
| 74 | 101010010.01010101 | 11111101.10111111101010... |
| 75 | 101010100.01010101 | 11111110.11111111101010... |
| 76 | 101010101.01010101 | 11111111.11111111101010... |
| 77 | 1000000000.1010101001 | 101010101.11111111101010... |
| 78 | 1000000010.0010101001 | 101010111.01111111101010... |
| 79 | 1000000100.0010101001 | 101011010.11011111101010... |
| 80 | 1000000101.0010101001 | 101011011.11011111101010... |
| 81 | 1000001000.1000101001 | 101011101.11011111101010... |
| 82 | 1000001010.0000101001 | 101011111.01011111101010... |
| 83 | 1000010000.0000101001 | 101101010.10110111101010... |
| 84 | 1000010001.0000101001 | 101101011.10110111101010... |
| 85 | 1000010010.0100101001 | 101101101.10110111101010... |
| 86 | 1000010100.0100101001 | 101101110.11110111101010... |
| 87 | 1000010101.0100101001 | 101101111.11110111101010... |
| 88 | 1000100000.1010001001 | 101110101.11110111101010... |
| 89 | 1000100010.0010001001 | 101110111.01110111101010... |
| 90 | 1000100100.0010001001 | 101111010.11010111101010... |
| 91 | 1000100101.0010001001 | 101111011.11010111101010... |
| 92 | 1000101000.1000001001 | 101111101.11010111101010... |
| 93 | 1000101010.0000001001 | 101111111.01010111101010... |
| 94 | 1001000000.0000001001 | 110101010.10101101101010... |
| 95 | 1001000001.0000001001 | 110101011.10101101101010... |
| 96 | 1001000010.0100001001 | 110101101.10101101101010... |
| 97 | 1001000100.0100001001 | 110101110.11101101101010... |
| 98 | 1001000101.0100001001 | 110101111.11101101101010... |
| 99 | 1001001000.1001001001 | 110110101.11101101101010... |
| 100 | 1001001010.0001001001 | 110110111.01101101101010... |