A037970 Numbers whose maximal base-2 run length is 3.
7, 8, 14, 17, 23, 24, 28, 29, 34, 35, 39, 40, 46, 49, 55, 56, 57, 58, 59, 68, 69, 70, 71, 72, 78, 81, 87, 88, 92, 93, 98, 99, 103, 104, 110, 113, 114, 115, 116, 117, 118, 119, 136, 137, 138, 139, 140, 141, 142, 145, 151, 152, 156, 157, 162, 163, 167, 168, 174
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Python
def ok(n): b = bin(n)[2:] return ("000" in b or "111" in b) and not ("0000" in b or "1111" in b) print(list(filter(ok, range(175)))) # Michael S. Branicky, Jul 08 2021
Extensions
a(55) and beyond from Michael S. Branicky, Jul 08 2021