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]] == 8 &] (* Amiram Eldar, Feb 02 2021 *)
PROG
(Python)
def eodiff(n):
digs = list(map(int, str(n)))
return abs(sum(d for d in digs if d%2==0)-sum(d for d in digs if d%2==1))
def aupto(lim): return [m for m in range(lim+1) if eodiff(m) == 8]
print(aupto(789)) # Michael S. Branicky, Feb 21 2021
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 02 2021
STATUS
approved