This is a good way to get the even square of a: Input A While fpart(Sqrt(A))=/=0 (not 0) A+1->A End Disp A