OFFSET
1,1
COMMENTS
The sequence is closed under concatenation (if k and m are terms, so are k.m and m.k); permutation of a term's string of digits; and insertion of 0's within a term's string of digits. - Michael S. Branicky, Feb 12 2022
EXAMPLE
a(1) = 123 whose sum of odd digits (4) is twice the sum of even digits (2);
a(2) = 132 whose sum of odd digits (4) is twice the sum of even digits (2);
a(3) = 147 whose sum of odd digits (8) is twice the sum of even digits (4).
MATHEMATICA
Select[Range[2000], Plus @@ Select[IntegerDigits[#], OddQ] == 2 * Plus @@ Select[IntegerDigits[#], EvenQ] &] (* Amiram Eldar, Feb 12 2022 *)
PROG
(Python)
def ok(n):
ds = list(map(int, str(n)))
return sum(d for d in ds if d%2==1) == 2*sum(d for d in ds if d%2==0)
print([k for k in range(1, 2173) if ok(k)]) # Michael S. Branicky, Feb 12 2022
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Carole Dubois and Eric Angelini, Feb 12 2022
STATUS
approved