OFFSET
1,1
COMMENTS
Squares have the last digit in {0, 1, 4, 5, 6, 9}, but the reverse is not always true since there are nonsquares that end with a digit in the same set. See Beiler.
REFERENCES
Albert H. Beiler, Recreations in the theory of numbers, New York, Dover, (2nd ed.) 1966. See p. 139.
MATHEMATICA
Select[Range[0, 125], !IntegerQ[Sqrt[#]]&&MemberQ[{0, 1, 4, 5, 6, 9}, Last[IntegerDigits[#]]] &]
PROG
(Python)
from math import isqrt
def ok(n): return n%10 in {0, 1, 4, 5, 6, 9} and isqrt(n)**2 < n
print([k for k in range(126) if ok(k)]) # Michael S. Branicky, Aug 04 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Stefano Spezia, Aug 04 2024
STATUS
approved