How many three-digit numbers satisfy the property that the middle digit is the average of the first and the last digits?
I think we should start with looking at the possible values of the middle digit. For example, if the number was $a 4 b$, then $4 = \frac{a+b}{2}$. Right, so that means that $a+b=8$. We also know that the number can't be a three-digit number if $a=0$. So $a$ can be any digit from 1 to 9. Right. So $a+b=2m$. If we know the value of $m$, then we know the value of $a+b$. So if $m=1$, then $a+b=2$. If $m=2$, then $a+b=4$. If $m=3$, then $a+b=6$. And so on. So if $m=9$, then $a+b=18$. Since $a$ can't be 0, then $a$ can be 1, 2, ..., 9. And since $a+b=2m$, then $b$ can also be 1, 2, ..., 9. Since $a+b$ must be even, then $a$ and $b$ must be either both even or both odd. So the only possible values of $a+b$ are 2, 4, 6, 8, 10, 12, 14, 16, 18. $2, 4, 6, 8, 10, 12, 14, 16, 18$ are all the even numbers between 2 and 18. So there are 9 possible values for $a+b$. And each value will correspond to a middle digit. So $a$ could be 1 and $b$ could be 1. Right, so 111 is a possibility. So there are 2 numbers where the middle digit is 1. If $m=2$, then we need to find one-digit integers $a$ and $b$ such that $a+b=4$ One solution is $a=2$ and $b=2$. So the number could be $2 2 2$. Another solution is $a=1$ and $b=3$. And another solution is $a=3$ and $b=1$. In that case, the number could be 420. So there are 4 numbers where the middle digit is 2. If $m=3$, then we need to find one-digit integers $a$ and $b$ such that $a+b=6$ One solution is $a=3$ and $b=3$. In that case, the number could be $3 3 3$. Another solution is $a=2$ and $b=4$. A third solution is $a=4$ and $b=2$. In that case, the number could be 432. Another solution when $m=3$ is $a=5$ and $b=1$. In that case, the number could be 531. Another solution when $m=3$ is $a=1$ and $b=5$. In that case, the number could be 153. In that case, the number could be 630. So there are 6 numbers where the middle digit is 3. We could keep doing this for each value of $m$. Alternatively, we could notice that for $m=1$, there are 2 possible numbers. The only solution is $a=9$ and $b=9$. In that case, the number could be $9 9 9$. So there is 1 number where the middle digit is 9. We could add up the number of possible numbers for each value of $m$ to get the total. Another solution is $a=9$ and $b=7$, which gives the number 987 So there are 3 possible numbers for $m=8$ For $m=7$, we need to find one-digit integers $a$ and $b$ such that $a+b=14$ One solution is $a=7$ and $b=7$, which gives the number 777 Another solution is $a=6$ and $b=8$, which gives the number 678 Another solution is $a=8$ and $b=6$, which gives the number 876 Another solution is $a=9$ and $b=5$, which gives the number 975 So there are 5 possible numbers for $m=7$ For $m=6$, we need to find one-digit integers $a$ and $b$ such that $a+b=12$ One solution is $a=6$ and $b=6$, which gives the number 666 Another solution is $a=5$ and $b=7$, which gives the number 567 Another solution is $a=7$ and $b=5$, which gives the number 765 Another solution is $a=4$ and $b=8$, which gives the number 468 Another solution is $a=8$ and $b=4$, which gives the number 864 Another solution is $a=3$ and $b=9$, which gives the number 369 Another solution is $a=9$ and $b=3$, which gives the number 963 So there are 7 possible numbers for $m=6$ For $m=5$, we need to find one-digit integers $a$ and $b$ such that $a+b=10$ One solution is $a=5$ and $b=5$, which gives the number 555 Another solution is $a=4$ and $b=6$, which gives the number 456 Another solution is $a=6$ and $b=4$, which gives the number 654 Another solution is $a=3$ and $b=7$, which gives the number 357 Another solution is $a=7$ and $b=3$, which gives the number 753 Another solution is $a=2$ and $b=8$, which gives the number 258 Another solution is $a=8$ and $b=2$, which gives the number 852 Another solution is $a=1$ and $b=9$, which gives the number 159 Another solution is $a=9$ and $b=1$, which gives the number 951 So there are 9 possible numbers for $m=5$ For $m=4$, we need to find one-digit integers $a$ and $b$ such that $a+b=8$ One solution is $a=4$ and $b=4$, which gives the number 444 Another solution is $a=3$ and $b=5$, which gives the number 345 Another solution is $a=5$ and $b=3$, which gives the number 543 Another solution is $a=2$ and $b=6$, which gives the number 246 Another solution is $a=6$ and $b=2$, which gives the number 642 Another solution is $a=1$ and $b=7$, which gives the number 147 Another solution is $a=7$ and $b=1$, which gives the number 741 So there are 8 possible numbers for $m=4$ So we can add up the number of possible numbers for each value of $m$ to get the total. We found 2 possible numbers for $m=1$, 4 possible numbers for $m=2$, 6 possible numbers for $m=3$, 8 possible numbers for $m=4$, 9 possible numbers for $m=5$, 7 possible numbers for $m=6$, 5 possible numbers for $m=7$, 3 possible numbers for $m=8$, and 1 possible number for $m=9$. So there are 2+4+6+8+9+7+5+3+1=45 possible three-digit numbers. So there are 45 three-digit numbers where the middle digit is the average of the first and last digits.

