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.

A037015 Numbers n with property that, reading binary expansion of n from right to left, run lengths strictly increase.

This page as a plain text file.
%I A037015 #48 Sep 14 2021 17:33:04
%S A037015 0,1,3,6,7,14,15,28,30,31,57,60,62,63,120,121,124,126,127,241,248,249,
%T A037015 252,254,255,483,496,497,504,505,508,510,511,966,993,995,1008,1009,
%U A037015 1016,1017,1020,1022,1023,1987,1990,2016,2017,2019,2032,2033,2040,2041,2044
%N A037015 Numbers n with property that, reading binary expansion of n from right to left, run lengths strictly increase.
%C A037015 There are A000009(k) elements of this list consisting of k bits. - _Jason Kimberley_, Jan 22 2013
%H A037015 Reinhard Zumkeller, <a href="/A037015/b037015.txt">Table of n, a(n) for n = 1..1000</a>
%H A037015 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%e A037015 From _Jason Kimberley_, Jan 30 2013: (Start)
%e A037015 Interleaved lines:
%e A037015 binary expansions,
%e A037015 corresponding run lengths (distinct partitions);
%e A037015 1,
%e A037015 1;
%e A037015 11,
%e A037015 2;
%e A037015 110, 111,
%e A037015 2,1; 3;
%e A037015 1110, 1111,
%e A037015 3,1; 4;
%e A037015 11100, 11110, 11111,
%e A037015 3,2; 4,1; 5;
%e A037015 111001, 111100, 111110, 111111,
%e A037015 3,2,1; 4,2; 5,1; 6;
%e A037015 1111000, 1111001, 1111100, 1111110, 1111111,
%e A037015 4,3; 4,2,1; 5,2; 6,1; 7;
%e A037015 11110001, 11111000, 11111001, 11111100, 11111110, 11111111
%e A037015 4,3,1; 5,3; 5,2,1; 6,2; 7,1; 8;
%e A037015 111100011, 111110000, 111110001, 111111000, 111111001, 111111100, 111111110, 111111111,
%e A037015 4,3,2; 5,4; 5,3,1; 6,3; 6,2,1; 7,2; 8,1; 9;
%e A037015 Notice the reversed sorting when a part corresponds to a run of 0's.
%e A037015 (End)
%t A037015 Select[Range[0,2500],Min[Differences[Length/@Split[ Reverse[ IntegerDigits[ #,2]]]]]>0&] (* _Harvey P. Dale_, Nov 18 2014 *)
%t A037015 Select[Range[0,2100],Max[Differences[Length/@Split[IntegerDigits[#,2]]]]<0&] (* _Harvey P. Dale_, Jun 28 2020 *)
%o A037015 (Haskell)
%o A037015 import Data.List (group)
%o A037015 a037015 n = a037015_list !! (n-1)
%o A037015 a037015_list = filter (all (> 0) . ds) [0..] where
%o A037015    ds x = zipWith (-) (tail gs) gs where
%o A037015       gs = map length $ group $ a030308_row x
%o A037015 -- _Reinhard Zumkeller_, Jul 31 2013, Mar 10 2012
%o A037015 (Python)
%o A037015 from itertools import groupby
%o A037015 A037015_list = []
%o A037015 for n in range(10**5):
%o A037015     c = None
%o A037015     for x, y in groupby(bin(n)[2:]):
%o A037015         z = len(list(y))
%o A037015         if c != None and z >= c:
%o A037015             break
%o A037015         c = z
%o A037015     else:
%o A037015         A037015_list.append(n) # _Chai Wah Wu_, Sep 14 2021
%Y A037015 Subsequence of A037016, cf. A037013, A037014.
%Y A037015 Cf. A030308.
%K A037015 nonn,easy,base,nice
%O A037015 1,3
%A A037015 _N. J. A. Sloane_
%E A037015 More terms from _Patrick De Geest_, Feb 15 1999
%E A037015 Offset fixed and missing 1023 inserted by _Reinhard Zumkeller_, Mar 10 2012