Bases & Digits
Non-decimal bases, digit manipulation, digit sums, palindromes
What you need to know
- What the digits mean. In base , the places stand for from right to left. So the digits mean . Each digit is a whole number from to , and the first digit is not . Example: .
- How many digits. A positive whole number has exactly digits in base exactly when . Example: the -digit numbers in base are through , since and .
- Converting to base . Divide by again and again; the remainders, read from last to first, are the digits. Or take away the largest power of that fits, as often as it fits, and repeat with smaller powers. Example: , , , , so .
- Base- numbers with letters. A two-digit number with digits and is (here is a digit, not a base); a three-digit one is . Reversing gives , and the difference is , always a multiple of . Example: .
- The digit-sum trick. A number and its digit sum leave the same remainder when divided by . We write , where "" means we compare remainders after dividing by . In base , use instead of . Example: and both leave remainder . In base , and both leave remainder when divided by .
- Palindromes. A palindrome reads the same both ways. A four-digit palindrome with digits equals . Since and , it is always divisible by . Example: .
How AMC 10 tests it
- " is written one way in base and another way in base (or base ); find or ." Write each form as a polynomial in and solve (problems 10–18).
- Digit puzzles: a number equals the product of its digits plus their sum, or reversing its digits multiplies it by a fixed number. Write it as and solve.
- Counting palindromes, or numbers with a digit property, in a range, sometimes in base or (problems 12–20).
- Digits of powers or factorials in another base, such as how many zeros ends with in base . Since , each zero uses up two s and one : count the s and s in , halve the count of s (rounding down), and take the smaller number. Example: has seven s and four s, so it ends in the smaller of and , which is zeros in base .
Standard approaches
- Turn every digit string into algebra at once. The base becomes an unknown whole number with limits on it.
- Use to narrow down before solving anything.
- Look at remainders after dividing by , , or to rule out cases quickly.
- To count numbers, build them digit by digit and multiply the choices. Treat the first digit separately, since it can't be .
- When the bases are small, convert and look. A table of small powers of and beats theory.
Worked example
When is written in base , it has exactly three digits and its last digit is . How many possible values of are there?
(A) (B) (C) (D) (E)
Step 1: three digits. We need .
Step 2: limits on . Since is less than and is more, . Since but , .
Step 3: last digit . The last digit is the remainder when is divided by . It is exactly when divides .
Step 4: count. has divisors . The ones from to are , , and . For example, .
The answer is .
Pitfalls
- Allowing a digit that is or more, or a first digit of ; either makes a "solution" invalid. Example: if you get for a number written , throw it out: base has no digit .
- Reading the remainders in the wrong order: the first remainder is the last (units) digit. Example: in base gives remainders ; written in that order, , not .
- Mixing up "exactly three digits" with "at most three digits." "At most" drops , which is what puts an upper limit on . Example: base writes with only two digits, so it must not count above.
- Assuming base- digit facts work in every base. The digit-sum test for works only because leaves remainder when divided by . Example: has digit sum , but is not divisible by .
Traps that recur
- Testing n = 1 alone (which yields many digit triples) or using C_n with n digits instead of 2n digits. (2018 AMC 10A #25)
- Treating the base-5 and base-6 strings as base-10 numbers without separating the units-digit condition from the tens-digit condition, or forgetting carries are impossible here. (2013 AMC 10B #25)
- Forgetting to drop b = 3 (below the required b ≥ 5) from the residue class 3 mod 8, which gives K = 759 and digit sum 21. (2024 AMC 10A #18)
- Counting the 17 alternating terms as 17 powers of two, or getting 8 * 17 = 136 and forgetting the final +1. (2020 AMC 10A #21)
- 1.2007 AMC 10A #22
A finite sequence of three-digit integers has the property that the tens and units digits of each term are, respectively, the hundreds and tens digits of the next term, and the tens and units digits of the last term are, respectively, the hundreds and tens digits of the first term. For example, such a sequence might begin with the terms 247, 475, and 756 and end with the term 824. Let be the sum of all the terms in the sequence. What is the largest prime factor that always divides ?
- A)
- B)
- C)
- D)
- E)
- 2.2018 AMC 10A #25
For a positive integer and nonzero digits , , and , let be the -digit integer each of whose digits is equal to ; let be the -digit integer each of whose digits is equal to , and let be the -digit (not -digit) integer each of whose digits is equal to . What is the greatest possible value of for which there are at least two values of such that ?
- A)
- B)
- C)
- D)
- E)
- 3.2013 AMC 10B #25
Bernardo chooses a three-digit positive integer and writes both its base-5 and base-6 representations on a blackboard. Later LeRoy sees the two numbers Bernardo has written. Treating the two numbers as base-10 integers, he adds them to obtain an integer . For example, if , Bernardo writes the numbers and , and LeRoy obtains the sum . For how many choices of are the two rightmost digits of , in order, the same as those of ?
- A)
- B)
- C)
- D)
- E)
Answers
| # | Answer | The idea it turns on |
|---|---|---|
| 1 | D | The digits wrap around, so each digit appears once as a hundreds, once as a tens and once as a ones digit. The sum is 111 times the digit total. |
| 2 | D | Using R = 11...1, the equation becomes (9c minus a squared) times R = b minus 2c. Two values of n force both sides to be 0. |
| 3 | E | The last digits in base 5 and base 6 must match, so N is 30m plus a remainder from 0 to 4. The tens digits then depend only on m. |
Problems © Mathematical Association of America (MAA), American Mathematics Competitions. Reproduced for non-commercial educational use. The topic note, tags and key insights are original to this site.