OFFSET
1,3
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
filter:= proc(n) local L, x, m;
L:= convert(n^2, base, 10) mod 2;
if n::odd then
if not member(0, L, m) then return true fi;
convert(L[m..-1], set) = {0}
else
if not member(1, L, m) then return true fi;
convert(L[m..-1], set) = {1}
fi
end proc:
select(filter, [$0..1000]); # Robert Israel, Oct 27 2024
PROG
(Python)
def ok(n):
s = "".join("0" if d in "02468" else "1" for d in str(n**2))
return len(set(s.rstrip(s[-1]))) < 2
print([k for k in range(141) if ok(k)]) # Michael S. Branicky, Oct 27 2024
CROSSREFS
KEYWORD
nonn,base,changed
AUTHOR
STATUS
approved