%I #17 May 22 2021 04:26:08
%S 0,2,4,6,24,44,86,244,424,444,846,2444,4424,6286,42424,44244,240244,
%T 244086,244866,268286,420846,442244,446286,628646,880646,2402444,
%U 4402044,4442244,8448666,24040244,24064866,26682086,26682866,26828666,28244244,42400424
%N Numbers with all digits even whose squares have all but one digit odd.
%C Of course, the one even digit in the square is always the last digit.
%H Chai Wah Wu, <a href="/A343728/b343728.txt">Table of n, a(n) for n = 1..100</a>
%e 244086 is a term: all its digits are even, and 244086^2 = 59577975396 has all but one digit odd.
%e 244044086 is a term: all its digits are even, and 244044086^2 = 59557515911575396 has all but one digit odd.
%t Select[Range[0, 10^6], AllTrue[IntegerDigits[#], EvenQ] && AllTrue[Most @ IntegerDigits[#^2], OddQ] &] (* _Amiram Eldar_, May 20 2021 *)
%o (Python)
%o def ok(n):
%o r, s = str(n), str(n*n)
%o return all(d in "02468" for d in r) and all(d in "13579" for d in s[:-1])
%o print(list(filter(ok, range(0, 42400425, 2)))) # _Michael S. Branicky_, May 20 2021
%o (Python)
%o from gmpy2 import digits
%o 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
%Y Cf. A014263, A030098, A343727.
%K nonn,base
%O 1,2
%A _Jon E. Schoenfield_, May 20 2021
|