%I #16 Feb 12 2022 13:29:08
%S 1,2,4,6,12,18,36,54,92,154,244,382,652,994,1572,2414,3884,5810,8996,
%T 13406,21148,31194,47508,70086,104844,156738,231044,338998,496300,
%U 721042,1064932,1536550,2232252,3213338,4628852,6603758,9554156,13545314,19354276
%N Number of binary words of length n with all distinct runs.
%C These are binary words where the runs of zeros have all distinct lengths and the runs of ones also have all distinct lengths. For n > 0 this is twice the number of terms of A175413 that have n digits in binary.
%H Mathematics Stack Exchange, <a href="https://math.stackexchange.com/q/87559">What is a sequence run? (answered 2011-12-01)</a>
%F a(n>0) = 2 * A351018(n).
%e The a(0) = 1 through a(4) = 12 binary words:
%e () 0 00 000 0000
%e 1 01 001 0001
%e 10 011 0010
%e 11 100 0011
%e 110 0100
%e 111 0111
%e 1000
%e 1011
%e 1100
%e 1101
%e 1110
%e 1111
%e For example, the word (1,1,0,1) has three runs (1,1), (0), (1), which are all distinct, so is counted under a(4).
%t Table[Length[Select[Tuples[{0,1},n],UnsameQ@@Split[#]&]],{n,0,10}]
%o (Python)
%o from itertools import groupby, product
%o def adr(s):
%o runs = [(k, len(list(g))) for k, g in groupby(s)]
%o return len(runs) == len(set(runs))
%o def a(n):
%o if n == 0: return 1
%o return 2*sum(adr("1"+"".join(w)) for w in product("01", repeat=n-1))
%o print([a(n) for n in range(20)]) # _Michael S. Branicky_, Feb 08 2022
%Y The version for compositions is A351013, lengths A329739, ranked by A351290.
%Y The version for [run-]lengths is A351017.
%Y The version for expansions is A351018, lengths A032020, ranked by A175413.
%Y The version for patterns is A351200, lengths A351292.
%Y The version for permutations of prime factors is A351202.
%Y A000120 counts binary weight.
%Y A001037 counts binary Lyndon words, necklaces A000031, aperiodic A027375.
%Y A005811 counts runs in binary expansion.
%Y A011782 counts integer compositions.
%Y A242882 counts compositions with distinct multiplicities.
%Y A297770 counts distinct runs in binary expansion.
%Y A325545 counts compositions with distinct differences.
%Y A329767 counts binary words by runs-resistance.
%Y A351014 counts distinct runs in standard compositions.
%Y A351204 counts partitions whose permutations all have all distinct runs.
%Y Cf. A003242, A098859, A106356, A116608, A238130 or A238279, A328592, A329738, A329745, A334028, A351201.
%K nonn
%O 0,2
%A _Gus Wiseman_, Feb 07 2022
%E a(25)-a(32) from _Michael S. Branicky_, Feb 08 2022
%E a(33)-a(38) from _David A. Corneth_, Feb 08 2022
|