Topics / Number Theory
Bases & Digits
Non-decimal bases, digit manipulation, digit sums, palindromes
What you need to know
- In base , the string represents , with each digit and .
- An integer has exactly digits in base if and only if .
- To convert to base , repeatedly divide by and read the remainders in reverse; or subtract the largest powers of greedily.
- Two-digit decimal number ; three-digit . Reversing digits of gives ; their difference is , always divisible by .
- Digit sum in base ; in base , digit sum .
- Palindromes: a four-digit palindrome is divisible by .
How AMC 10 tests it
- "The number in base is and in base (or base ) is ; find or ": set up a polynomial equation in (problems 10–18).
- Digit-manipulation puzzles: a number equals the product of its digits plus their sum, or its digit reversal is a fixed multiple; write and solve.
- Counting palindromes or numbers with a digit property in a range, sometimes in base or (problems 12–20).
- Base- digits of powers or factorials, e.g., trailing zeros of in base , requiring exponent counts of the primes of .
Standard approaches
- Translate every digit string into an algebraic expression at once; the "base" is then an unknown integer with bounds.
- Use the digit-count inequality to bound before solving anything.
- Reduce mod , , or to eliminate cases quickly.
- For counting, build numbers digit by digit and multiply choices, treating the leading digit separately.
- When bases are small, just convert and look; a table of small powers of and is faster than 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)
Three digits means . Since , we need ; since , we need . The last digit is , so it is exactly when . Divisors of between and are , , and . That gives bases, so the answer is .
Pitfalls
- Allowing a digit , or a leading digit of ; both make a "solution" invalid.
- Reading remainders in the wrong order when converting (the first remainder is the last digit).
- Confusing "three-digit" with "at most three digits," which drops the lower bound on .
- Assuming base- digit facts carry over: the digit-sum test for works only because .
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)
Problems, easiest first
What is the value of
The sum of two natural numbers is . One of the two numbers is divisible by . If the units digit of that number is erased, the other number is obtained. What is the difference of these two numbers?
Mary thought of a positive two-digit number. She multiplied it by and added . Then she switched the digits of the result, obtaining a number between and , inclusive. What was Mary's number?
What is the sum of the digits of the square of ?
A digital watch displays hours and minutes with AM and PM. What is the largest possible sum of the digits in the display?
The arithmetic mean of the nine numbers in the set is a -digit number , all of whose digits are distinct. The number doesn't contain the digit
The value of the two-digit number in base seven equals the value of the two-digit number in base nine. What is
For which of the following integers is the base- number not divisible by ?
A two-digit positive integer is said to be if it is equal to the sum of its nonzero tens digit and the square of its units digit. How many two-digit positive integers are cuddly?
Driving along a highway, Megan noticed that her odometer showed (miles). This number is a palindrome-it reads the same forward and backward. Then hours later, the odometer displayed the next higher palindrome. What was her average speed, in miles per hour, during this -hour period?
Ximena lists the whole numbers through once. Emilio copies Ximena's numbers, replacing each occurrence of the digit by the digit . Ximena adds her numbers and Emilio adds his numbers. How much larger is Ximena's sum than Emilio's?
Isaac added two three-digit positive integers. All six digits in these numbers are different. Isaac's sum is a three-digit number . What is the smallest possible value for the sum of the digits of ?
How many three-digit numbers are not divisible by , have digits that sum to less than , and have the first digit equal to the third digit?
A palindrome, such as , is a number that remains the same when its digits are reversed. The numbers and are three-digit and four-digit palindromes, respectively. What is the sum of the digits of ?
The sum of the digits of a two-digit number is subtracted from the number. The units digit of the result is . How many two-digit numbers have this property?
The sum of the two 5-digit numbers and is . What is ?
Let denote the sum of the digits of the positive integer . For example, and . For how many two-digit values of is ?
Let and denote the product and the sum, respectively, of the digits of the integer . For example, and . Suppose is a two-digit number such that . What is the units digit of ?
A digital display shows the current date as an -digit integer consisting of a -digit year, followed by a -digit month, followed by a -digit date within the month. For example, Arbor Day this year is displayed as For how many dates in does each digit appear an even number of times in …
Let be a positive integer and be a digit such that the value of the numeral in base equals , and the value of the numeral in base equals the value of the numeral in base six. What is
What is the greatest possible sum of the digits in the base-seven representation of a positive integer less than ?
For some positive integer , the repeating base- representation of the (base-ten) fraction is . What is ?
How many nonnegative integers can be written in the form where for ?
How many of the base-ten numerals for the positive integers less than or equal to contain the digit ?
Let equal the sum of the digits of positive integer . For example, . For a particular positive integer , . Which of the following could be the value of ?
Hexadecimal (base-16) numbers are written using numeric digits through as well as the letters through to represent through . Among the first positive integers, there are whose hexadecimal representation contains only numeric digits. What is the sum of the digits of ?
Danica drove her new car on a trip for a whole number of hours, averaging miles per hour. At the beginning of the trip, miles was displayed on the odometer, where is a 3-digit number with and . At the end of the trip, the odometer showed miles. What is …
The product , where the second factor has digits, is an integer whose digits have a sum of . What is ?
In the addition shown below and are distinct digits. How many different values are possible for ?
In base , the number ends in the digit . In base , on the other hand, the same number is written as and ends in the digit . For how many positive integers does the base- -representation of end in the digit ?
The number has the property that its units digit is the sum of its other digits, that is . How many integers less than but greater than share this property?
A palindrome between and is chosen at random. What is the probability that it is divisible by ?
How many three-digit numbers satisfy the property that the middle digit is the average of the first and the last digits?
The two digits in Jack's age are the same as the digits in Bill's age, but in reverse order. In five years Jack will be twice as old as Bill will be then. What is the difference in their current ages?
A base-10 three digit number is selected at random. Which of the following is closest to the probability that the base-9 representation and the base-11 representation of are both three-digit numerals?
There are exactly positive integers such that the base- integer is divisible by (where is in base ten). What is the sum of the digits of ?
There exists a unique strictly increasing sequence of nonnegative integers such that What is
How many four-digit integers , with , have the property that the three two-digit integers form an increasing arithmetic sequence? One such number is , where , , , and .
For each positive integer , let denote the sum of the digits of For how many values of is
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 …
Let denote the smallest positive integer that is divisible by both and and whose base- representation consists of only 's and 's, with at least one of each. What are the last four digits of
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 …
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 …