login
A343728
Numbers with all digits even whose squares have all but one digit odd.
2
0, 2, 4, 6, 24, 44, 86, 244, 424, 444, 846, 2444, 4424, 6286, 42424, 44244, 240244, 244086, 244866, 268286, 420846, 442244, 446286, 628646, 880646, 2402444, 4402044, 4442244, 8448666, 24040244, 24064866, 26682086, 26682866, 26828666, 28244244, 42400424
OFFSET
1,2
COMMENTS
Of course, the one even digit in the square is always the last digit.
LINKS
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