long long k=1000000, T=269696, n boolean first=true Document doc$ n=Sqrt(269696) For n=n to k { If n^2&& mod k = T Then doc$=format$("The "+if$(first->"smallest", "next")+" number whose square ends in {0} is {1}, Its square is {2}", T, n, n**2&&)+{ } first=false refresh end if } clipboard doc$ report doc$