OFFSET
1,1
LINKS
Mathematics Stack Exchange, What is a sequence run? (answered 2011-12-01)
EXAMPLE
The terms together with their binary expansions begin:
5: 101 41: 101001 74: 1001010
9: 1001 42: 101010 75: 1001011
10: 1010 43: 101011 76: 1001100
17: 10001 45: 101101 77: 1001101
18: 10010 46: 101110 80: 1010000
20: 10100 51: 110011 81: 1010001
21: 10101 53: 110101 82: 1010010
22: 10110 54: 110110 83: 1010011
26: 11010 58: 111010 84: 1010100
27: 11011 65: 1000001 85: 1010101
33: 100001 66: 1000010 86: 1010110
34: 100010 68: 1000100 87: 1010111
36: 100100 69: 1000101 89: 1011001
37: 100101 72: 1001000 90: 1011010
40: 101000 73: 1001001 91: 1011011
For example, 77 has binary expansion 1001101, with runs 1, 00, 11, 0, 1, which are not all distinct, so 77 is in the sequence.
MAPLE
q:= proc(n) uses ListTools; (l-> is(nops(l)<>add(
nops(i), i={Split(`=`, l, 1)}) +add(
nops(i), i={Split(`=`, l, 0)})))(Bits[Split](n))
end:
select(q, [$1..200])[]; # Alois P. Heinz, Mar 14 2022
MATHEMATICA
Select[Range[0, 100], !UnsameQ@@Split[IntegerDigits[#, 2]]&]
PROG
(Python)
from itertools import groupby, product
def ok(n):
runs = [(k, len(list(g))) for k, g in groupby(bin(n)[2:])]
return len(runs) > len(set(runs))
print([k for k in range(130) if ok(k)]) # Michael S. Branicky, Feb 09 2022
CROSSREFS
A000120 counts binary weight.
A011782 counts integer compositions.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A325545 counts compositions with distinct differences.
A334028 counts distinct parts in standard compositions.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
- A351202 = permutations of prime factors.
KEYWORD
nonn,base
AUTHOR
Gus Wiseman, Feb 07 2022
STATUS
approved