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.

A175946 List the run lengths of n's binary runs of zeros, then interpret this list as lengths of runs of alternating ones and zeros in binary.

This page as a plain text file.
%I A175946 #17 Dec 01 2021 03:52:41
%S A175946 0,1,0,3,1,1,0,7,3,2,1,3,1,1,0,15,7,6,3,4,2,2,1,7,3,2,1,3,1,1,0,31,15,
%T A175946 14,7,12,6,6,3,8,4,5,2,4,2,2,1,15,7,6,3,4,2,2,1,7,3,2,1,3,1,1,0,63,31,
%U A175946 30,15,28,14,14,7,24,12,13,6,12,6,6,3,16,8,9,4,11,5,5,2,8,4,5,2,4,2,2,1
%N A175946 List the run lengths of n's binary runs of zeros, then interpret this list as lengths of runs of alternating ones and zeros in binary.
%C A175946 A variant of A175945, where in the first (analyzing) step not the runs of 1's but the runs of 0's determine the list of run lengths. The second (synthesizing) step is the same in both sequences. - _R. J. Mathar_, May 28 2011
%H A175946 Paul Tek, <a href="/A175946/b175946.txt">Table of n, a(n) for n = 1..10000</a>
%e A175946 From _R. J. Mathar_, May 28 2011: (Start)
%e A175946 N=16 is 10000 in binary which has one run of 4 zeros, and its run-length encoding is 4. This is interpreted as one run of 4 one's, 1111, which back to decimal is a(16)=15.
%e A175946 N=14 is 1110 in binary which has one run of 1 zero, and its run-length encoding is 1. This is interpreted as one run of 1 one, 1, which is in decimal a(14)=1.
%e A175946 N=19 is 10011 in binary which has one run of 2 zeros, and its run-length encoding is 2. This is interpreted as one run of 2 ones, 11, which back to decimal is a(19)=3. (End)
%t A175946 takelist[l_, t_] := Module[{lent, term},Set[lent, Length[t]]; Table[l[[t[[y]]]], {y, 1, lent}]]
%t A175946 frombinrep[x_] := FromDigits[Flatten[Table[Table[If[OddQ[n], 1, 0], {d, 1, x[[n]]}], {n, 1, Length[x]}]], 2]
%t A175946 binrep[x_] := repcount[IntegerDigits[x, 2]]
%t A175946 onebinrep[x_]:=Module[{b},b=binrep[x];takelist[b,Range[1,Length[b],2]]]
%t A175946 zerobinrep[x_]:=Module[{b},b=binrep[x];takelist[b,Range[2,Length[b],2]]]
%t A175946 Table[frombinrep[zerobinrep[n]], {n,START,END}]
%K A175946 base,nonn
%O A175946 1,4
%A A175946 _Dylan Hamilton_, Oct 28 2010