login
A341008
Numbers whose sum of even digits and sum of odd digits differ by 7.
2
7, 18, 29, 70, 81, 92, 108, 115, 126, 133, 144, 151, 162, 180, 209, 216, 238, 261, 283, 290, 313, 328, 331, 346, 364, 382, 414, 436, 441, 458, 463, 485, 511, 548, 566, 584, 612, 621, 634, 643, 656, 665, 678, 687, 700, 768, 786, 801, 810, 823, 832, 845, 854, 867, 876, 889, 898
OFFSET
1,1
LINKS
MATHEMATICA
Select[Range[1000], Abs[Plus @@ Select[(d = IntegerDigits[#]), OddQ] - Plus @@ Select[d, EvenQ]] == 7 &] (* Amiram Eldar, Feb 02 2021 *)
PROG
(Python)
def ok(n):
s = str(n)
return abs(sum(map(int, s))-2*sum(int(d) for d in s if d in "2468")) == 7
print(list(filter(ok, range(900)))) # Michael S. Branicky, Jul 18 2021
CROSSREFS
Cf. A036301 (sums are equal), A341002 to A341010 (sums differ by 1 to 9).
Sequence in context: A017473 A131191 A061876 * A103571 A365414 A103572
KEYWORD
base,nonn,less
AUTHOR
Eric Angelini and Carole Dubois, Feb 02 2021
STATUS
approved