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.

A175597 Minimal run length in binary representation of n.

This page as a plain text file.
%I A175597 #8 Feb 10 2019 13:27:58
%S A175597 1,1,2,1,1,1,3,1,1,1,1,2,1,1,4,1,1,1,1,1,1,1,1,2,1,1,1,2,1,1,5,1,1,1,
%T A175597 1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,1,3,1,1,1,2,1,1,6,1,1,1,1,1,
%U A175597 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,1,1,1,2,1,1
%N A175597 Minimal run length in binary representation of n.
%p A175597 A175597 := proc(n) local dgs,odig,runl,thisr,i ; dgs := convert(n,base,2) ; odig := -1 ; runl := nops(dgs)+1 ; thisr := 0 ; for i from 1 to nops(dgs) do d := op(i,dgs) ; if i = 1 then thisr := 1; else if d <> odig then if thisr < runl then runl := thisr ; end if; thisr := 1 ; else thisr := thisr+1 ; end if; end if; odig := d ; end do: if thisr < runl then runl := thisr ; end if; return runl ; end proc: seq(A175597(n),n=1..130) ; # _R. J. Mathar_, Jul 26 2010
%Y A175597 Cf. A043276.
%K A175597 nonn,base
%O A175597 1,3
%A A175597 _Juri-Stepan Gerasimov_, Jul 21 2010