Take a test Sign in 中文
← Exercise 461 →
Search
Go to
{{searchResults.length}} {{searchResults.length === 1 ? 'result' : 'results'}} for “{{searchWords}}” No results found for “{{searchWords}}” × back to contents
Contents · by chapter
Basic Counting (147)
Balls in Boxes (6)
Probability (142)

Exercises and their solutions

Exercise 461
How many four-digit numbers have the property that the sum of the two middle digits equals the sum of the first and last digits?
← Back to Problem 461
Solution
  1. Write the number as $\overline{abcd}$ with $a+d=b+c$. First allow $a=0$ as well, and count strings of four digits.
  2. The number of pairs of digits with sum $s$ is $s+1$ for $0\le s\le9$ and $19-s$ for $10\le s\le18$. Choosing the pair $(a,d)$ and the pair $(b,c)$ with the same sum $s$ gives
    \[1^2+2^2+\dots+10^2+9^2+\dots+1^2=385+285=670\]
    strings.
  3. Now remove the strings with $a=0$. Then $d=b+c$, so $(b,c)$ is any pair of digits with $b+c\le9$, and $d$ is determined. There are $1+2+\dots+10=55$ such pairs.
  4. So the answer is $670-55=\boxed{615}$.
Search Go to Prev      Next

Contact Us

Thanks! Your message has been sent.
By year