cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A351017 Number of binary words of length n with all distinct run-lengths.

This page as a plain text file.
%I A351017 #14 Feb 12 2022 13:41:22
%S A351017 1,2,2,6,6,10,22,26,38,54,114,130,202,266,386,702,870,1234,1702,2354,
%T A351017 3110,5502,6594,9514,12586,17522,22610,31206,48630,60922,83734,111482,
%U A351017 149750,196086,261618,336850,514810,631946,862130,1116654,1502982,1916530,2555734,3242546
%N A351017 Number of binary words of length n with all distinct run-lengths.
%F A351017 a(n>0) = 2 * A032020(n).
%e A351017 The a(0) = 1 through a(6) = 22 words:
%e A351017   {}  0   00   000   0000   00000   000000
%e A351017       1   11   001   0001   00001   000001
%e A351017                011   0111   00011   000011
%e A351017                100   1000   00111   000100
%e A351017                110   1110   01111   000110
%e A351017                111   1111   10000   001000
%e A351017                             11000   001110
%e A351017                             11100   001111
%e A351017                             11110   011000
%e A351017                             11111   011100
%e A351017                                     011111
%e A351017                                     100000
%e A351017                                     100011
%e A351017                                     100111
%e A351017                                     110000
%e A351017                                     110001
%e A351017                                     110111
%e A351017                                     111001
%e A351017                                     111011
%e A351017                                     111100
%e A351017                                     111110
%e A351017                                     111111
%t A351017 Table[Length[Select[Tuples[{0,1},n],UnsameQ@@Length/@Split[#]&]],{n,0,10}]
%o A351017 (Python)
%o A351017 from itertools import groupby, product
%o A351017 def adrl(s):
%o A351017     runlens = [len(list(g)) for k, g in groupby(s)]
%o A351017     return len(runlens) == len(set(runlens))
%o A351017 def a(n):
%o A351017     if n == 0: return 1
%o A351017     return 2*sum(adrl("1"+"".join(w)) for w in product("01", repeat=n-1))
%o A351017 print([a(n) for n in range(20)]) # _Michael S. Branicky_, Feb 08 2022
%Y A351017 Using binary expansions instead of words gives A032020, ranked by A044813.
%Y A351017 The version for partitions is A098859.
%Y A351017 The complement is counted by twice A261982.
%Y A351017 The version for compositions is A329739, for runs A351013.
%Y A351017 For runs instead of run-lengths we have A351016, twice A351018.
%Y A351017 The version for patterns is A351292, for runs A351200.
%Y A351017 A000120 counts binary weight.
%Y A351017 A001037 counts binary Lyndon words, necklaces A000031, aperiodic A027375.
%Y A351017 A005811 counts runs in binary expansion.
%Y A351017 A011782 counts integer compositions.
%Y A351017 A242882 counts compositions with distinct multiplicities.
%Y A351017 A297770 counts distinct runs in binary expansion.
%Y A351017 A325545 counts compositions with distinct differences.
%Y A351017 A329767 counts binary words by runs-resistance.
%Y A351017 A351014 counts distinct runs in standard compositions.
%Y A351017 A351204 counts partitions where every permutation has all distinct runs.
%Y A351017 A351290 ranks compositions with all distinct runs.
%Y A351017 Cf. A003242, A098504, A106356, A116608, A175413, A233564, A238130 or A238279, A328592, A334028, A350952.
%K A351017 nonn
%O A351017 0,2
%A A351017 _Gus Wiseman_, Feb 07 2022
%E A351017 a(25)-a(32) from _Michael S. Branicky_, Feb 08 2022
%E A351017 More terms from _David A. Corneth_, Feb 08 2022 using data from A032020