Skip to main content

2026 AIME I Problem 2

Problem 2 of 15EasierNumber TheoryCombinatorics

Find the number of positive integer palindromes written in base 10,10, with no zero digits, and whose digits add up to 13.13. For example, 4212442124 has these properties. Recall that a palindrome is a number whose representation reads the same from left to right as from right to left.

Your answer

Integer from 0 to 999
Show solution

Solution

A palindrome with an even number of digits has each digit appearing in a mirrored pair, so its digit sum is even. Since 1313 is odd, the palindrome has an odd number of digits, and if mm is the middle digit, the rest of the digit sum 13−m13 - m is split evenly between the two halves, so mm is odd. A one-digit palindrome would need m=13,m = 13, which is impossible. The palindrome is determined by its middle digit mm and the block of digits to the left of center: a nonempty string of nonzero digits with sum s=13−m2.s = \frac{13 - m}{2}. For m=1,3,5,7,9m = 1, 3, 5, 7, 9 we get s=6,5,4,3,2.s = 6, 5, 4, 3, 2. Since s≤6,s \le 6, every digit of such a string is automatically at most 9,9, so the number of strings is the number of compositions of s,s, which is 2s−12^{s-1} (each of the s−1s - 1 gaps between units is either a break or not). The total is 25+24+23+22+21=32+16+8+4+2=62. \begin{aligned} &2^{5} + 2^{4} + 2^{3} + 2^{2} + 2^{1} \\ &= 32 + 16 + 8 + 4 + 2 \\ &= 62. \end{aligned}
AoPS wiki

Tagged: palindrome · digits · partitions and compositions · parity

More practice