# Math Help - Sum of digits of squares

1. ## Sum of digits of squares

Hello all,
Q. How many numbers between 1-2000 , have sum of digits of respective squares as 21 ?
I am interested to know the working rather than the answer, Thanks to all

The sum of the digits of a number is congruent to the number itself mod 9. So the sum of the digits of $n^2$ is congruent to $n^2$ mod 9. But a square has to be congruent to 0, 1, 4 or 7 (mod 9), and 21 is congruent to 3 (mod 9).