OFFSET
1,1
COMMENTS
When a square ends with 5, it ends with 25.
From Marius A. Burtea, Oct 25 2021: (Start)
Numbers 75, 765, 7665, 76665, ..., (23*10^k -5) / 3, k >= 1, are terms and have no digits 0, because their squares are 5625, 585225, 58752225, 5877522225, 587775222225, 58777752222225, ...
Also 75, 735, 7335, 73335, ..., (22*10^n+5) / 3, k >= 1, are terms and have no digits 0, because their squares are 5625, 540225, 53802225, 5378022225, 537780222225, 53777802222225, ... (End)
EXAMPLE
75^2 = 5625, hence 75 is a term.
235^2 = 55225, hence 235 is not a term.
MATHEMATICA
Select[5 * Range[2, 1500], (d = IntegerDigits[#^2])[[1]] == d[[-1]] == 5 && d[[2]] != 5 &] (* Amiram Eldar, Oct 25 2021 *)
PROG
(PARI) isok(k) = my(d=digits(sqr(k))); (d[1]==5) && (d[#d]==5) && if (#d>2, (d[2]!=5) && (d[#d-1]!=5), 1); \\ Michel Marcus, Oct 25 2021
(Magma) [n:n in [4..7500]|Intseq(n*n)[1] eq 5 and Intseq(n*n)[#Intseq(n*n)] eq 5 and Intseq(n*n)[-1+#Intseq(n*n)] ne 5 ]; // Marius A. Burtea, Oct 25 2021
(Python)
from itertools import count, takewhile
def ok(n):
s = str(n*n); return len(s.rstrip("5")) == len(s.lstrip("5")) == len(s)-1
def aupto(N):
r = takewhile(lambda x: x<=N, (10*i+5 for i in count(0)))
return [k for k in r if ok(k)]
print(aupto(7245)) # Michael S. Branicky, Oct 26 2021
CROSSREFS
Subsequence of A305719.
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Oct 25 2021
STATUS
approved