Number bases: formulas
Try questions on this topic ▶Converting a number to base ten
(d2d1d0)b = d2×b2 + d1×b1 + d0×b0
Also: (0.d1d2)b = d1×b-1 + d2×b-2
- d0, d1, d2
- the digits, counted from the right starting at 0
- b
- the base of the number
- b0
- equals 1 for any base
When a question asks you to change a number in another base into base ten, or to compare numbers written in different bases.
Converting from base ten to another base
Divide the base-ten number by b again and again; the remainders read from the last to the first give the digits
Also: Base b to base c: convert to base ten first, then divide by c repeatedly
- b
- the new base you are converting to
When a question asks you to write a base-ten number (or a number from another base) in base two, five, eight or any other base.
Adding, subtracting and multiplying in base b
In base b: carry 1 for every b you make; when you borrow 1 from the next column it is worth b
Also: Or: convert to base ten, work it out, then convert the answer back to base b
- b
- the base you are working in
When a question asks for a sum, difference, product or quotient of numbers given in the same base, with the answer in that base.
Finding an unknown base or digit
Write both sides in base ten using place values, then solve the equation for the unknown
Also: A digit in base b must be less than b
- b or n
- the unknown base
- k
- an unknown digit
When a question gives an equation between numbers in different (or unknown) bases and asks for the base or a missing digit.
Modular (clock) arithmetic
a ≡ r (mod m), where r is the remainder when a is divided by m (0 ≤ r < m)
Also: (a + b) mod m = remainder of (a + b) ÷ m · (a × b) mod m = remainder of (a × b) ÷ m
- a
- the number
- m
- the modulus
- r
- the remainder, from 0 to m − 1
When a question uses mod or modulo, or asks you to solve an equation like 3x ≡ 2 (mod 5).