login
A044887
Numbers having, in base 16, (sum of even run lengths)=(sum of odd run lengths).
3
4097, 4098, 4099, 4100, 4101, 4102, 4103, 4104, 4105, 4106, 4107, 4108, 4109, 4110, 4111, 4113, 4130, 4147, 4164, 4181, 4198, 4215, 4232, 4249, 4266, 4283, 4300, 4317, 4334, 4351, 4353, 4354, 4355, 4356, 4357, 4358
OFFSET
1,1
PROG
(Python)
from itertools import groupby
def ok(n):
rl_sums = [0, 0]
for k, g in groupby(hex(n)[2:]):
rl = len(list(g))
rl_sums[rl%2] += rl
return rl_sums[0] == rl_sums[1]
print(list(filter(ok, range(4359)))) # Michael S. Branicky, Sep 11 2021
KEYWORD
nonn,base
STATUS
approved