Just want to make sue you're excluding one possible branch here for the sake of the problem - i.e. what stops me from just using a large-number library I already have laying around? You can sure use right$ on that. Is it cheating?
Find the lowest number which squared ends in ...269696
Say, does this problem have a name or other origin I can cite bplus? I'm looking to write it up and want to credit where ever the question started.
100 :
110 REM BABBAGE PROBLEM
120 :
130 DEF FN ST(A) = N - INT (A) * INT (A)
140 N = 269696
150 N = N + 1000000
160 R = SQR (N)
170 IF FN ST(R) < > 0 AND N < 999999999 THEN GOTO 150
180 IF N > 999999999 THEN GOTO 210
190 PRINT "SMALLESt NUMBER WHOSE
SQUARE ENDS IN"; CHR$ (13);
"269696 IS ";R;", AND THE
SQUARE IS"; CHR$ (13);N
200 END
210 PRINT "THERE IS NO SOLUTION
FOR VALUES SMALLER"; CHR$(13);
"THAN 999999999."