OFFSET
1,2
COMMENTS
A044813 contains those positive integers that when written in binary, have all run-lengths (of both 0's and 1's) distinct.
A175414 contains those positive integers in A175413 that are not in A044813. (A175414 contains those positive integers that when written in binary, at least one run of 0's is the same length as one run of 1's, even though all run of 0 are of distinct length and all runs of 1's are of distinct length.)
Also numbers whose binary expansion has all distinct runs (not necessarily run-lengths). - Gus Wiseman, Feb 21 2022
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
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 *)
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(1, 125) if ok(k)]) # Michael S. Branicky, Feb 22 2022
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.
KEYWORD
nonn,base
AUTHOR
Leroy Quet, May 07 2010
EXTENSIONS
Extended by Ray Chandler, Oct 21 2011
STATUS
approved