OFFSET
1,1
LINKS
Carole Dubois, Table of n, a(n) for n = 1..5001
MATHEMATICA
Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 4 &] (* Amiram Eldar, Feb 02 2021 *)
PROG
(Python)
def ok(n):
sums = [0, 0]
for d in str(n): sums[d in "13579"] += int(d)
return abs(sums[0] - sums[1]) == 4
print(list(filter(ok, range(759)))) # Michael S. Branicky, Apr 13 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini and Carole Dubois, Feb 02 2021
STATUS
approved