Olympiad Maths Prep

Track / Stage 5 / 86 of 400 #686 of 2000

Problem 686

AIME late
Combinatorics Difficulty 5.2 Find the answer

8. If the four digits of the four-digit number abcd\overline{a b c d} satisfy a+b=c+da+b=c+d, then it is called a "good number" (for example, 2011 is a good number). Then, the number of good numbers is \qquad

Official solution

8. 615 .

Let k=a+b=c+dk=a+b=c+d.
Since 1a9,0bcd91 \leqslant a \leqslant 9,0 \leqslant b 、 c 、 d \leqslant 9, then
1k181 \leqslant k \leqslant 18.
When 1k91 \leqslant k \leqslant 9, in the above equation, aa can take any value in {1,2\{1,2, ,k}\cdots, k\}, cc can take any value in {0,1,,k}\{0,1, \cdots, k\}, and once aca 、 c are determined, bdb 、 d are also determined. Therefore, the number of four-digit numbers abcd\overline{a b c d} that satisfy the condition is k(k+1)k(k+1).
When 10k1810 \leqslant k \leqslant 18, abcda 、 b 、 c 、 d cannot be 0.
 Let a1=10a,b1=10b,c1=10c,d1=10d. \begin{array}{l} \text { Let } a_{1}=10-a, b_{1}=10-b, \\ c_{1}=10-c, d_{1}=10-d . \end{array}

Then 1a1b1c1d191 \leqslant a_{1} 、 b_{1} 、 c_{1} 、 d_{1} \leqslant 9.
Let k1=a1+b1=c1+d1k_{1}=a_{1}+b_{1}=c_{1}+d_{1}. Then 2k1102 \leqslant k_{1} \leqslant 10, and
the four-digit number abcd\overline{a b c d} corresponds one-to-one with the four-digit number a1b1c1d1\overline{a_{1} b_{1} c_{1} d_{1}}.
In the above equation, a1a_{1} and c1c_{1} can take any value in {1,2,,k11}\left\{1,2, \cdots, k_{1}-1\right\}, and once a1c1a_{1} 、 c_{1} are determined, b1d1b_{1} 、 d_{1} are also determined.

Therefore, the number of four-digit numbers a1b1c1d1\overline{a_{1} b_{1} c_{1} d_{1}} that satisfy k1=a1+b1=c1+d1k_{1}=a_{1}+b_{1}=c_{1}+d_{1} is (k11)2\left(k_{1}-1\right)^{2}.
Thus, the total number of good numbers is
k=19k(k+1)+k1=210(k11)2=330+285=615. \begin{array}{l} \sum_{k=1}^{9} k(k+1)+\sum_{k_{1}=2}^{10}\left(k_{1}-1\right)^{2} \\ =330+285=615 . \end{array}

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.