The following program displays all perfect squares, the last two digits of which (in base 10) are odd:
int main(void){ return 0; }
If the last digit n 2 is odd, then n itself must be odd, n = 2*k + 1 for some k . Then
n^2 = (2*k + 1)^2 = 4*k*(k+1) + 1
has the form 4*m + 1 . But 10 = 2*4 + 2 , therefore, if the penultimate digit is odd, this gives a remainder of 2 modulo 4. To get the form number 4*m + 1 , the last digit must have the form 4*s + 3 , which means that it should be 3 or 7. But there are no perfect square ends at 3 or 7. Therefore, there is no perfect square whose last two digits (in base 10) are odd .
Maybe your professor asked for the first perfect square, whose first two digits are strange?
source share