A175413 Those positive integers n that when written in binary, the lengths of the runs of 1 are distinct and the lengths of the runs of 0's are distinct.
1, 2, 3, 4, 6, 7, 8, 11, 12, 13, 14, 15, 16, 19, 23, 24, 25, 28, 29, 30, 31, 32, 35, 38, 39, 44, 47, 48, 49, 50, 52, 55, 56, 57, 59, 60, 61, 62, 63, 64, 67, 70, 71, 78, 79, 88, 92, 95, 96, 97, 98, 103, 104, 111, 112, 113, 114, 115, 116, 120, 121, 123, 124, 125
Offset: 1
Links
- Alois P. Heinz, Table of n, a(n) for n = 1..20000
Crossrefs
The complement is A351205.
A000120 counts binary weight.
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.
Programs
-
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
f[n_] := And@@Unequal@@@Transpose[Partition[Length/@Split[IntegerDigits[n, 2]], 2, 2, {1,1}, 0]]; Select[Range[125], f] (* Ray Chandler, Oct 21 2011 *) Select[Range[0,100],UnsameQ@@Split[IntegerDigits[#,2]]&] (* Gus Wiseman, Feb 21 2022 *)
-
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(1, 125) if ok(k)]) # Michael S. Branicky, Feb 22 2022
Extensions
Extended by Ray Chandler, Oct 21 2011
Comments