Perfect Square - Prove the Computation Time Estimate

my prof was asking me to write a program to find and print the first perfect square (i*i) whose last two digits are both odd.
my answer was this which completely wrong. please any one can help me to fix this program.
And please explain in theory, any program that you write to solve the above problem will
run for infinite time.