# 2014 AMC 12A Problems/Problem 15

## Problem

A five-digit palindrome is a positive integer with respective digits $abcba$, where $a$ is non-zero. Let $S$ be the sum of all five-digit palindromes. What is the sum of the digits of $S$? $\textbf{(A) }9\qquad \textbf{(B) }18\qquad \textbf{(C) }27\qquad \textbf{(D) }36\qquad \textbf{(E) }45\qquad$

## Solution 1

For each digit $a=1,2,\ldots,9$ there are $10\cdot10$ (ways of choosing $b$ and $c$) palindromes. So the $a$s contribute $(1+2+\cdots+9)(100)(10^4+1)$ to the sum. For each digit $b=0,1,2,\ldots,9$ there are $9\cdot10$ (since $a \neq 0$) palindromes. So the $b$s contribute $(0+1+2+\cdots+9)(90)(10^3+10)$ to the sum. Similarly, for each $c=0,1,2,\ldots,9$ there are $9\cdot10$ palindromes, so the $c$ contributes $(0+1+2+\cdots+9)(90)(10^2)$ to the sum.

It just so happens that $$(1+2+\cdots+9)(100)(10^4+1)+(1+2+\cdots+9)(90)(10^3+10)+(1+2+\cdots+9)(90)(10^2)=49500000$$ so the sum of the digits of the sum is $\boxed{\textbf{(B)}\; 18}$.

## Solution 2

Notice that $10001+ 99999 = 110000.$ In fact, ordering the palindromes in ascending order, we find that the sum of the nth palindrome and the nth to last palindrome is $110000.$ We have $9*10*10$ palindromes, or $450$ pairs of palindromes summing to $110000.$ Performing the multiplication gives $49500000$, so the sum $\boxed{\textbf{(B)}\; 18}$.

## Solution 3

As shown above, there are a total of $900$ five-digit palindromes. We can calculate their sum by finding the expected value of a randomly selected palindrome satisfying the conditions given, then multiplying it by $900$ to get our sum. The expected value for the ten-thousands and the units digit is $\frac{1+2+3+\cdots+9}{9}=5$, and the expected value for the thousands, hundreds, and tens digit is $\frac{0+1+2+\cdots+9}{10}=4.5$. Therefore our expected value is $5\times10^4+4.5\times10^3+4.5\times10^2+4.5\times10^1+5\times10^0=55,\!000$. Since the question asks for the sum of the digits of the resulting sum, we do not need to keep the trailing zeros of either $55,\!000$ or $900$. Thus we only need to calculate $55\times9=495$, and the desired sum is $\boxed{\textbf{(B) }18}$.

## Solution 4 (Variation of #2)

First, allow $a$ to be zero, and then subtract by how much we overcount. We'll also sum each palindrome with its $\textit{complement}$. If $abcba$ is a palindrome, then its complement is $defed$ where $d=9-a$, $e=9-b$, $f=9-c$. Notice how every palindrome has a unique compliment, and that the sum of a palindrome and its complement is $99999$. Therefore, the sum of our palindromes is $99999\times (10^3/2)$. (There are $10^3/2$ pairs.)

However, we have overcounted, as something like $05350$ $\textit{isn't}$ a palindrome by the problem's definition, but we've still included it. So we must subtract the sum of numbers in the form $nmn0$. By the same argument as before, these sum to $9990\times (10^2/2)$. Therefore, the sum that the problem asks for is: $$500\times99999-50\times 9990$$ $$=500\times99999-500\times 999$$ $$=500(99999-999)$$ $$=500\times 99000$$

Since all we care about is the sum of the digits, we can drop the $0$'s. $$5\times99$$ $$=5\times(100-1)$$ $$=495$$

And finally, $4+9+5=\boxed{\textbf{(B)}18}$

The problems on this page are copyrighted by the Mathematical Association of America's American Mathematics Competitions.
{"ft_lang_label":"__label__en","ft_lang_prob":0.8805709,"math_prob":0.99997807,"size":2486,"snap":"2021-31-2021-39","text_gpt3_token_len":628,"char_repetition_ratio":0.1780822,"word_repetition_ratio":0.046025105,"special_character_ratio":0.26387772,"punctuation_ratio":0.113131315,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999999,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,10,null,10,null,null,null,7,null,null,null,null,null,10,null,10,null,null,null,null,null,5,null,5,null,5,null,5,null,null,null,5,null,5,null,null,null,5,null,null,null,2,null,5,null,5,null,5,null,null,null,5,null,5,null,5,null,5,null,2,null,5,null,5,null,5,null,5,null,5,null,null,null,5,null,5,null,5,null,5,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-08-05T21:46:17Z\",\"WARC-Record-ID\":\"<urn:uuid:4f1db275-10a7-45ae-8d6e-835671023cc9>\",\"Content-Length\":\"52563\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:db66627d-ec79-4d9b-b3a8-7ae82c2b4bc3>\",\"WARC-Concurrent-To\":\"<urn:uuid:d0a8c2d6-ee75-4024-8891-c51fb65555a4>\",\"WARC-IP-Address\":\"104.26.10.229\",\"WARC-Target-URI\":\"https://artofproblemsolving.com/wiki/index.php?title=2014_AMC_12A_Problems/Problem_15&oldid=144627\",\"WARC-Payload-Digest\":\"sha1:L3XICLW7X65VD4U4RHU27ETDTPSRNVF6\",\"WARC-Block-Digest\":\"sha1:P7Y7BFTGCIAXVO5RDKR5GC6IP3BGLF2P\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-31/CC-MAIN-2021-31_segments_1627046157039.99_warc_CC-MAIN-20210805193327-20210805223327-00447.warc.gz\"}"}