A043719 Numbers whose base-16 representation has an odd number of runs.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 273, 288, 289, 291, 292, 293, 294, 295
Offset: 1
Programs
-
Python
from itertools import groupby def ok(n): return len(list(g for k, g in groupby(hex(n)[2:])))%2 == 1 print(list(filter(ok, range(1, 296)))) # Michael S. Branicky, Jun 18 2021