login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 3 09:56 EDT 2024. Contains 372207 sequences. (Running on oeis4.)