login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A341009
Numbers whose sum of even digits and sum of odd digits differ by 8.
2
8, 17, 26, 35, 44, 53, 62, 71, 80, 107, 129, 170, 192, 206, 219, 224, 237, 242, 255, 260, 273, 291, 305, 327, 349, 350, 372, 394, 404, 422, 439, 440, 457, 475, 493, 503, 525, 530, 547, 552, 569, 574, 596, 602, 620, 659, 677, 695, 701, 710, 723, 732, 745, 754, 767, 776, 789
OFFSET
1,1
LINKS
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
Cf. A009994, A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).
Sequence in context: A273188 A017257 A052222 * A044441 A189381 A190749
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Carole Dubois, Feb 02 2021
STATUS
approved