OFFSET
1,1
COMMENTS
When a square ends in exactly two identical digits, these digits are necessarily 00 or 44, so all terms are even.
The numbers are of the form: 10*floor((10*k-1)/9), k > 0, or, 50*floor((10*k-1)/9) +- 38, k > 0.
Equivalently: m is in the sequence iff either (m == 0 (mod 10) and m <> 0 (mod 100)) or (m == +- 38 (mod 50) and m <> +- 38 (mod 500)).
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,-1).
FORMULA
a(n+63) = a(n) + 500.
EXAMPLE
12 is in the sequence because 12^2 = 144 ends in two 4's.
20 is in the sequence because 20^2 = 400 ends in two 0's.
38 is not in the sequence because 38^2 = 1444 ends in three 4's.
MATHEMATICA
Select[Range[10, 460], (d = IntegerDigits[#^2])[[-1]] == d[[-2]] != d[[-3]] &] (* Amiram Eldar, Jul 29 2021 *)
PROG
(Python)
def ok(n): s = str(n*n); return len(s) > 2 and s[-1] == s[-2] != s[-3]
print(list(filter(ok, range(461)))) # Michael S. Branicky, Jul 29 2021
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Bernard Schott, Jul 29 2021
STATUS
approved