|
|
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.
|
|
41
|
|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
|
|
|
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:
|
|
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))
|
|
CROSSREFS
|
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
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|