Representation of numbers in arbitrary bases

When we write a number in base 10, anan−1an−2⋅⋅⋅a1a0, it must be intended as

an 10n + an−110n−1 + ... + a1 10 + a0

where ai are integers such that 0 ≤ ai < 10. For example 2452 is

2452 = 2⋅ 103 + 4 ⋅ 102 + 5 ⋅ 10 + 2

where the ai are such that 0 ≤ ai < 8.

We can obtain the digits of a number in the following way: if we divide a number by 10 its remainder will be its last digits.

2452 = 245 ⋅ 10 + 2

If we continue and divide the quotient and take the remainder of the division, we find the next digit

245 = 24 ⋅ 10 + 5

Thus the coefficients ai of the decimal representation of a number a univocally determined. The role played by the base 10 can be played out by any other integer ≥ 2. For example is the base is 8

anan−1an−2⋅⋅⋅a1a0 = an 8n + an−18n−1 + ... + a1 8 + a0

In general the following proposition holds true

Proposition 4.36. Let b ≥ 2 an integer. Any integer a ≥ 0 can be represented univocally using b as a base as

a = rn bn + rn−1bn−1 + ... + r1 b + r0

with the ri such that 0 ≤ ai < b.

Proof. We use induction. If a = 0 there's nothing to prove. Supposing the proposition true for any integer <a we prove it for a. Dividing a by the b base we have

a = b ⋅ q + r0   0 ≤ r0 < b

The quotient q is less than a thus for the induction hyphotesis is representable univocally as

q = rn bn−1 + rn−1 bn−2 + ... + r2 b + r1

since the ri are univocally determined and such that 0 ≤ ri < bi, it follows that

a = b ⋅ q + r0 = b(rn bn−1 + rn−1 bn−2 + ... + r2 b + r1) + r0

This expression is unique since both quotient q and remainder r0 of the first division are univocally determined; the expression of q is unique for the induction hyphothesis.□

Any number less than b is represented by a unique "symbol" or digit, there are exaclty b such digits. In the binary system b = 2 there are two digits 0 and 1.

« Euler's function and theorem Index Complex Numbers »