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.

A227737 n occurs as many times as there are runs in binary representation of n.

This page as a plain text file.
%I A227737 #22 Jul 23 2021 17:32:13
%S A227737 1,2,2,3,4,4,5,5,5,6,6,7,8,8,9,9,9,10,10,10,10,11,11,11,12,12,13,13,
%T A227737 13,14,14,15,16,16,17,17,17,18,18,18,18,19,19,19,20,20,20,20,21,21,21,
%U A227737 21,21,22,22,22,22,23,23,23,24,24,25,25,25,26,26,26,26
%N A227737 n occurs as many times as there are runs in binary representation of n.
%C A227737 a(n) = the least integer k such that A173318(k) >= n, which implies that each n occurs A005811(n) times.
%C A227737 Although as such quite uninteresting, this sequence is useful for computing irregular tables like A101211, A227736, A227738 and A227739.
%H A227737 Antti Karttunen, <a href="/A227737/b227737.txt">Table of n, a(n) for n = 1..5120</a>
%e A227737 1 has one run in its binary representation "1", thus 1 occurs once.
%e A227737 2 has two runs in its binary representation "10", thus 2 occurs twice.
%e A227737 3 has one run in its binary representation "11", thus 3 occurs only once.
%e A227737 4 has two runs in its binary representation "100", thus 4 occurs twice.
%e A227737 5 has three runs in its binary representation "101", thus 5 occurs three times.
%e A227737 The sequence thus begins as 1, 2,2, 3, 4,4, 5,5,5, ...
%t A227737 Table[ConstantArray[n, Length@ Split@ IntegerDigits[n, 2]], {n, 26}] // Flatten (* _Michael De Vlieger_, May 09 2017 *)
%t A227737 Table[PadRight[{},Length[Split[IntegerDigits[n,2]]],n],{n,40}]//Flatten (* _Harvey P. Dale_, Jul 23 2021 *)
%o A227737 (Scheme with _Antti Karttunen_'s IntSeq-library) (define A227737 (LEAST-GTE-I 1 1 A173318))
%Y A227737 Cf. A227740, A227741, A005811, A173318.
%K A227737 nonn,base
%O A227737 1,2
%A A227737 _Antti Karttunen_, Jul 25 2013