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.

A175930 Concatenation of run lengths in binary expansion of n, written in base 2, then converted to base 10.

This page as a plain text file.
%I A175930 #16 Aug 14 2025 04:25:01
%S A175930 1,3,2,6,7,5,3,7,13,15,14,10,11,7,4,12,15,27,26,30,31,29,15,11,21,23,
%T A175930 22,14,15,9,5,13,25,31,30,54,55,53,27,31,61,63,62,58,59,31,28,20,23,
%U A175930 43,42,46,47,45,23,15,29,31,30,18,19,11,6,14,27,51,50,62,63,61,31,55,109,111
%N A175930 Concatenation of run lengths in binary expansion of n, written in base 2, then converted to base 10.
%H A175930 Rémy Sigrist, <a href="/A175930/b175930.txt">Table of n, a(n) for n = 1..8192</a>
%F A175930 From _Rémy Sigrist_, Jul 02 2019: (Start)
%F A175930 a(2^k-1) = k for any k > 0.
%F A175930 a(2^k) = A004755(k) for any k > 0. (End)
%e A175930 6 = 110, two runs, lengths 2 and 1, so we write down 101 and convert it to base 10, getting 5. So a(6) = 5.
%t A175930 f[n_] := FromDigits[Flatten[IntegerDigits[Length /@ Split[IntegerDigits[n, \ 2]], 2]], 2]
%t A175930 Array[f, NUMBER OF TERMS]
%o A175930 (PARI) a(n) = my (b=[]); while (n, my (x=valuation(n+(n%2), 2)); b = concat(binary(x), b); n \= 2^x); fromdigits(b, 2) \\ _Rémy Sigrist_, Jul 02 2019
%o A175930 (Python)
%o A175930 from itertools import groupby
%o A175930 def a(n):
%o A175930     c = "".join(bin(len(list(g)))[2:] for k, g in groupby(bin(n)[2:]))
%o A175930     return int(c, 2)
%o A175930 print([a(n) for n in range(1, 75)]) # _Michael S. Branicky_, Oct 02 2021
%Y A175930 Cf. A004755, A101211, A321226.
%K A175930 base,easy,look,nonn
%O A175930 1,2
%A A175930 _Dylan Hamilton_, Oct 23 2010
%E A175930 Edited by _N. J. A. Sloane_, Oct 23 2010