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.

A090077 In binary expansion of n: reduce contiguous blocks of 1's to 1.

This page as a plain text file.
%I A090077 #25 Jul 28 2022 13:55:18
%S A090077 0,1,2,1,4,5,2,1,8,9,10,5,4,5,2,1,16,17,18,9,20,21,10,5,8,9,10,5,4,5,
%T A090077 2,1,32,33,34,17,36,37,18,9,40,41,42,21,20,21,10,5,16,17,18,9,20,21,
%U A090077 10,5,8,9,10,5,4,5,2,1,64,65,66,33,68,69,34,17,72,73,74,37,36,37,18,9
%N A090077 In binary expansion of n: reduce contiguous blocks of 1's to 1.
%H A090077 Reinhard Zumkeller, <a href="/A090077/b090077.txt">Table of n, a(n) for n = 0..10000</a>
%H A090077 <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>
%F A090077 a(a(n)) = a(n); a(A090078(n)) = A090078(a(n)) = A090079(n).
%F A090077 a(A003714(n)) = A003714(n); a(A004780(n)) < A004780(n); a(n) <= A179821(n); A085357(a(n)) = 1. - _Reinhard Zumkeller_, Jul 31 2010
%e A090077 100 -> '1100100' -> [11]00[1]00 -> [1]00[1]00 -> '100100' -> 36=a(100).
%t A090077 Array[FromDigits[Flatten[Split@ IntegerDigits[#, 2] /. w_List /; First[w] == 1 -> {1}], 2] &, 80, 0] (* _Michael De Vlieger_, Jul 28 2022 *)
%o A090077 (Python)
%o A090077 def a(n):
%o A090077     b = bin(n)[2:]
%o A090077     while "11" in b: b = b.replace("11", "1")
%o A090077     return int(b, 2)
%o A090077 print([a(n) for n in range(81)]) # _Michael S. Branicky_, Jul 27 2022
%Y A090077 Cf. A007088, A090079, A090078, A348710.
%K A090077 nonn,base
%O A090077 0,3
%A A090077 _Reinhard Zumkeller_, Nov 20 2003