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 A165933 #14 Mar 14 2022 08:45:42 %S A165933 1,4,35,536,16775,1060976,135007759,34460631520,17617985239071, %T A165933 18027600169142208,36907002795598798911,151143401509104346210176, %U A165933 1238053384151947477501575295,20283338091738780737237428502272,664629209970464486086782992577855743 %N A165933 Least integer, k, whose value is n in A165413. %C A165933 An alternative name: The smallest number whose binary expansion has exactly n distinct run-lengths. - _Gus Wiseman_, Feb 21 2022 %C A165933 Term a(n) has one 1, followed by n 0's, then two 1's, (n-1) 0's, ..., up to n runs; see Python program. - _Michael S. Branicky_, Feb 22 2022 %H A165933 Michael S. Branicky, <a href="/A165933/b165933.txt">Table of n, a(n) for n = 1..81</a> %e A165933 a(1) in binary is 1, a(2) in binary is 100, a(3) in binary is 100011, a(4) in binary is 1000011000, etc. %e A165933 From _Gus Wiseman_, Feb 21 2022: (Start) %e A165933 The terms and their binary expansions begin: %e A165933 n a(n) %e A165933 1: 1 = 1 %e A165933 2: 4 = 100 %e A165933 3: 35 = 100011 %e A165933 4: 536 = 1000011000 %e A165933 5: 16775 = 100000110000111 %e A165933 6: 1060976 = 100000011000001110000 %e A165933 7: 135007759 = 1000000011000000111000001111 %e A165933 8: 34460631520 = 100000000110000000111000000111100000 %e A165933 9: 17617985239071 = 100000000011000000001110000000111100000011111 %e A165933 (End) %t A165933 g[n_] := Table[ {Table[1, {i}], Table[0, {n - i + 1}]}, {i, Floor[(n + If[ OddQ@n, 1, 0])/2]}]; f[n_] := FromDigits[ If[ OddQ@n, Flatten@ Most@ Flatten[ g@n, 1], Flatten@ g@n], 2]; Array[f, 14] %t A165933 s=Table[Length[Union[Length/@Split[IntegerDigits[n,2]]]],{n,0,1000}]; Table[Position[s,k][[1,1]]-1,{k,Union[s]}] (* _Gus Wiseman_, Feb 21 2022 *) %o A165933 (Python) %o A165933 def a(n): # returns term by construction %o A165933 if n == 1: return 1 %o A165933 q, r = divmod(n+1, 2) %o A165933 s = "".join("1"*i + "0"*(n+1-i) for i in range(1, q+1)) %o A165933 if r == 0: s = s.rstrip("0") %o A165933 return int(s, 2) %o A165933 print([a(n) for n in range(1, 16)]) # _Michael S. Branicky_, Feb 22 2022 %Y A165933 A subset of A044813 (distinct run-lengths) and of A175413 (distinct runs). %Y A165933 These are the positions of first appearances in A165413. %Y A165933 The version for runs instead of run-lengths is A350952, firsts of A297770. %Y A165933 A000120 counts binary weight. %Y A165933 A005811 counts runs in binary expansion. %Y A165933 A242882 counts compositions with distinct multiplicities. %Y A165933 A318928 gives runs-resistance of binary expansion. %Y A165933 A351014 counts distinct runs in standard compositions. %Y A165933 Counting words with all distinct run-lengths: %Y A165933 - A032020 = binary expansions, for runs A351018. %Y A165933 - A329739 = compositions, for runs A351013. %Y A165933 - A351017 = binary words, for runs A351016. %Y A165933 - A351292 = patterns, for runs A351200. %Y A165933 Cf. A003242, A070939, A085207, A098859, A325545, A328592, A351015, A351202, A351203, A351291. %K A165933 easy,nonn %O A165933 1,2 %A A165933 _Robert G. Wilson v_, Sep 30 2009 %E A165933 a(15) and beyond from _Michael S. Branicky_, Feb 22 2022