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