OFFSET
1,2
COMMENTS
Of course, the one even digit in the square is always the last digit.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..100
EXAMPLE
244086 is a term: all its digits are even, and 244086^2 = 59577975396 has all but one digit odd.
244044086 is a term: all its digits are even, and 244044086^2 = 59557515911575396 has all but one digit odd.
MATHEMATICA
Select[Range[0, 10^6], AllTrue[IntegerDigits[#], EvenQ] && AllTrue[Most @ IntegerDigits[#^2], OddQ] &] (* Amiram Eldar, May 20 2021 *)
PROG
(Python)
def ok(n):
r, s = str(n), str(n*n)
return all(d in "02468" for d in r) and all(d in "13579" for d in s[:-1])
print(list(filter(ok, range(0, 42400425, 2)))) # Michael S. Branicky, May 20 2021
(Python)
from gmpy2 import digits
A343728_list = [n for n in (2*int(digits(d, 5)) for d in range(10**6)) if set(str(n**2)[:-1]) <= set('13579')] # Chai Wah Wu, May 21 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jon E. Schoenfield, May 20 2021
STATUS
approved