Here was the solution that I stumbled upon, but I'm sure it can be improved upon: $$ 1^2=1 \\ 2^2 = 4 \\ 3^2 = 9 \\ \ldots \\ 20^2 = 400 $$ The last digits of square numbers repeat in the following pattern: $1,4,9,6,5,6,9,4,1,0$. It seems like square numbers can end in any digit except $2,3,7, \text{and }8$. Proof that the pattern always repeats: $$(n+10)^2=n^2+20n+100=n^2+10(2n+10)$$ A number plus a multiple of $10$ does not change its last digit, so the pattern will always repeat.
I have two questions:
- Can my solution be improved upon (e.g. by generalising it further)?
- Do you have any advice for getting to the solution more quickly when you are finding the answer to these problem solving-type questions? Even though the mathematics I used to find the solution to this problem was rather elementary, it took me half an hour of complete guess-work to find it. Is there a more structured approach one can take?