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 A044813 #43 Jan 04 2021 05:13:18 %S A044813 1,3,4,6,7,8,14,15,16,24,28,30,31,32,35,39,48,49,55,57,59,60,62,63,64, %T A044813 67,79,96,97,111,112,120,121,123,124,126,127,128,131,135,143,159,192, %U A044813 193,223,224,225,239,241,247,248,249,251,252,254,255,256,259,263 %N A044813 Positive integers having distinct base-2 run lengths. %C A044813 A005811(a(n)) = A165413(a(n)). - _Reinhard Zumkeller_, Mar 02 2013 %C A044813 From _Emeric Deutsch_, Jan 25 2018: (Start) %C A044813 Also, the indices of the compositions that have distinct parts. For the definition of the index of a composition see A298644. For example, 223 is in the sequence since its binary form is 11011111 and the composition [2,1,5] has distinct parts. 100 is not in the sequence since its binary form is 1100100 and the parts of the composition [2,2,1,2] are not distinct. %C A044813 The command c(n) from the Maple program yields the composition having index n. (End) %H A044813 Reinhard Zumkeller and Gheorghe Coserea, <a href="/A044813/b044813.txt">Table of n, a(n) for n = 1..20000</a> (first 5000 terms from Reinhard Zumkeller) %F A044813 a(Sum_{k=0..n} A032020(k)) = 2^n, for n>1. - _Gheorghe Coserea_, May 30 2017 %p A044813 Runs := proc (L) local j, r, i, k: j := 1: r[j] := L[1]: for i from 2 to nops(L) do if L[i] = L[i-1] then r[j] := r[j], L[i] else j := j+1: r[j] := L[i] end if end do: [seq([r[k]], k = 1 .. j)] end proc: RunLengths := proc (L) map(nops, Runs(L)) end proc: c := proc (n) ListTools:-Reverse(convert(n, base, 2)): RunLengths(%) end proc: A := {}: for n to 300 do if nops(convert(c(n), set)) = nops(c(n)) then A := `union`(A, {n}) else end if end do: A; # most of the Maple program is due to _W. Edwin Clark_. - _Emeric Deutsch_, Jan 25 2018 %t A044813 f[n_] := Unequal@@Length/@Split[IntegerDigits[n,2]]; Select[Range[300],f] (* _Ray Chandler_, Oct 21 2011 *) %o A044813 (Haskell) %o A044813 import Data.List (group, nub) %o A044813 a044813 n = a044813_list !! (n-1) %o A044813 a044813_list = filter p [1..] where %o A044813 p x = nub xs == xs where %o A044813 xs = map length $ group $ a030308_row x %o A044813 -- _Reinhard Zumkeller_, Mar 02 2013 %o A044813 (PARI) %o A044813 is(n) = { %o A044813 my(v = 0, hist = vector(1 + logint(n+1, 2))); %o A044813 while(n != 0, %o A044813 v = valuation(n, 2); n >>= v; n++; %o A044813 hist[v+1]++; if (hist[v+1] >= 2, return(0)); %o A044813 v = valuation(n, 2); n >>= v; n--; %o A044813 hist[v+1]++; if (hist[v+1] >= 2, return(0))); %o A044813 return(1); %o A044813 }; %o A044813 seq(n) = { %o A044813 my(k = 1, top = 0, v = vector(n)); %o A044813 while(top < n, if (is(k), v[top++] = k); k++); %o A044813 return(v); %o A044813 }; %o A044813 seq(59) \\ _Gheorghe Coserea_, Nov 02 2015 %o A044813 (Python) %o A044813 from itertools import groupby %o A044813 def ok(n): %o A044813 runlengths = [len(list(g)) for k, g in groupby(bin(n)[2:])] %o A044813 return len(runlengths) == len(set(runlengths)) %o A044813 print([i for i in range(1, 264) if ok(i)]) # _Michael S. Branicky_, Jan 04 2021 %Y A044813 Cf. A030308, A298644. %K A044813 nonn,base %O A044813 1,2 %A A044813 _Clark Kimberling_ %E A044813 Extended by _Ray Chandler_, Oct 21 2011