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.

A258059 Let n = Sum_{i=0..k} d_i*4^i be the base-4 expansion of n, with 0 <= d_i < 4. Then a(n) = minimal i such that d_i is not 1, or k+1 if there is no such i.

This page as a plain text file.
%I A258059 #92 Nov 17 2015 18:59:51
%S A258059 1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,3,0,0,0,1,0,0,0,1,0,0,0,1,0,
%T A258059 0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,
%U A258059 2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1
%N A258059 Let n = Sum_{i=0..k} d_i*4^i be the base-4 expansion of n, with 0 <= d_i < 4. Then a(n) = minimal i such that d_i is not 1, or k+1 if there is no such i.
%C A258059 This is the "General Ruler Sequence Base 4 Focused at 1" of Webster (2015).
%H A258059 N. J. A. Sloane, <a href="/A258059/b258059.txt">Table of n, a(n) for n = 1..10000</a>
%H A258059 Richard C. Webster, <a href="https://onedrive.live.com/redir?resid=820CC6AC8786ECC8!26212&amp;authkey=!AJKZJSXac5BuoDc&amp;ithint=file%2cpdf">One Sequence to Rule Them All: The Ruler Sequence and Its Relation to Odd Perfect Numbers and Multiplicative Order</a>, MS Thesis, California State Polytechnic University, Pomona, CA, 2015.
%F A258059 Recurrence: a(1)=1; thereafter a(4*n+1) = a(n)+1, a(4*n+j) = 0 for j = 0,2,3. G.f. g(x) = Sum_{k>=0} k * x^((4^k-1)/3) * (1 + x^(2*4^k) + x^(3*4^k))/(1 - x^(4*4^k)) satisfies g(x) = x*g(x^4) + x/(1-x^4). - _Robert Israel_, Jun 08 2015
%e A258059 1 = 0*4+1, so a(1)=1.
%e A258059 7 = 1*4+3, so a(7)=0.
%e A258059 21 = 0*4^3+1*4^2+1*4+1, so a(21)=3.
%e A258059 523 base 10 is 20023 in base 4, so a(523)=0.
%e A258059 1365 base 10 is 111111 in base 4, so a(1365)=6.
%p A258059 f:= proc(n)
%p A258059   if n mod 4 = 1 then procname((n-1)/4) + 1 else 0 fi
%p A258059 end proc:
%p A258059 map(f, [$1..1000]); # _Robert Israel_, Jun 08 2015
%o A258059 (PARI) a(n) = {v = Vecrev(digits(n, 4)); for (i=1, #v, if (v[i] != 1, return (i-1));); return(#v);}
%o A258059 (Haskell)
%o A258059 a258059 = f 0 . a030386_row where
%o A258059    f i [] = i
%o A258059    f i (t:ts) = if t == 1 then f (i + 1) ts else i
%o A258059 -- _Reinhard Zumkeller_, Nov 08 2015
%Y A258059 The nonzero terms give A263845.
%Y A258059 This sequence and A263845 are analogs of the pair of ruler sequences A007814 and A001511.
%Y A258059 Cf. A007090, A235127.
%Y A258059 Cf. A030386.
%K A258059 nonn,easy,base
%O A258059 1,5
%A A258059 _Richard C. Webster_, May 17 2015
%E A258059 Edited by _N. J. A. Sloane_, Oct 31 2015 and Nov 06 2015.