Browse · MATH
Printjmc
number theory senior
Problem
The first 2007 positive integers are each written in base 3. How many of these base-3 representations are palindromes? (A palindrome is a number that reads the same forward and backward.)
Solution
Because , it is convenient to begin by counting the number of base-3 palindromes with at most 7 digits. There are two palindromes of length 1, namely 1 and 2. There are also two palindromes of length 2, namely 11 and 22. For , each palindrome of length is obtained by inserting one of the digits , , or immediately after the digit in a palindrome of length . Each palindrome of length is obtained by similarly inserting one of the strings , , or . Therefore there are 6 palindromes of each of the lengths 3 and 4, 18 of each of the lengths 5 and 6, and 54 of length 7. Because the base-3 representation of 2007 is 2202100, that integer is less than each of the palindromes 2210122, 2211122, 2212122, 2220222, 2221222, and 2222222. Thus the required total is .
Final answer
100