3 There are many sets of two different positive integers $a$ and $b$, both less than 50 , such that $a^{2}$ and $b^{2}$ end in the same last two digits. For example, $35^{2}=1225$ and $45^{2}=2025$ both end in 25 . What are all possible values for the average of $a$ and $b$ ?
For the purposes of this problem, single-digit squares are considered to have a leading zero, so for example we consider $2^{2}$ to end with the digits 04 , not 4 .
Solution: Assume that $b$ is the larger of the two numbers. Then $b^{2}$ and $a^{2}$ end in the same last two digits, so $b^{2}-a^{2}$ is a multiple of 100 . That is, using the difference of squares to factor, $(b+a) \cdot(b-a)$ is a multiple of 100 , and hence also a multiple of both 4 and 25 .
For the product to be a multiple of 25 , either at least one of the numbers is a multiple of 25 , or both are multiples of 5 . If they are both multiples of 5 , then $a$ must be a multiple of 5 , so $a^{2}$ ends in 25 or 00 . There are many possibilities of this kind: Ending in 25, we have 5 and 15, 5 and 25, 5 and 35, and so on, up through 35 and 45, giving averages of $10,15,20,25,30,35$, and 40 . Ending in 00 , we have 10 and 20 , and so on, up through 30 and 40 , which gives the same list of averages. (We did give credit if you included 50 and thus put 45 in your list of possible averages.)
Now let's consider the possibility that one of the numbers is a multiple of 25 . Neither $a-b$ nor $a+b$ could equal 25 or 75 , because if they did, then one of $a$ and $b$ is odd, while the other is even, so their squares can't end in the same digit. Also, $b-a$ can't be 50 , because $b<50$. So the only way to obtain a multiple of 25 is for $b+a=50$, in which case the average is 25 .
Of course, you could also simply list all the squares from $1^{2}$ through $49^{2}$ and find all the pairs with the same last two digits!