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!)
A036301 Numbers whose sum of even digits and sum of odd digits are equal. 33
0, 112, 121, 134, 143, 156, 165, 178, 187, 211, 314, 336, 341, 358, 363, 385, 413, 431, 516, 538, 561, 583, 615, 633, 651, 718, 781, 817, 835, 853, 871, 1012, 1021, 1034, 1043, 1056, 1065, 1078, 1087, 1102, 1120, 1201, 1210, 1223, 1232, 1245, 1254, 1267, 1276, 1289, 1298 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

John Cerkan, Table of n, a(n) for n = 1..10000

MATHEMATICA

Select[Range[0, 10000], Plus @@Select[IntegerDigits[ # ], OddQ]\[Equal]Plus @@Select[IntegerDigits[ # ], EvenQ]&] (* Zak Seidov, Feb 17 2005 *)

PROG

(Magma) [ n: n in [0..1300] | (#A eq 0 select 0 else &+A) eq (#B eq 0 select 0 else &+B) where A is [ d: d in D | IsOdd(d) ] where B is [ d: d in D | IsEven(d) ] where D is Intseq(n) ];

(PARI) select( is_A036301(n)=!vecsum(apply(t->(-1)^t*t, digits(n))), [0..1999]) \\ This defines the function is_A036301(); the surrounding select(...) just serves as a check and illustration. - M. F. Hasler, Dec 09 2018

(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) == 0]

print(aupto(1298)) # Michael S. Branicky, Feb 21 2021

CROSSREFS

Sequence in context: A096680 A109383 A281926 * A117723 A359142 A329719

Adjacent sequences: A036298 A036299 A036300 * A036302 A036303 A036304

KEYWORD

nonn,base

AUTHOR

Patrick De Geest, Dec 15 1998

EXTENSIONS

Zero added by Zak Seidov, Nov 22 2010

Name edited by Michel Marcus, Jan 14 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 March 28 05:31 EDT 2023. Contains 361577 sequences. (Running on oeis4.)