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.

A037854 Sum_{i=1..m, d(i)>d(i-1)} d(i)-d(i-1), where Sum_{i=0..m} d(i)*4^i is the base 4 representation of n.

This page as a plain text file.
%I A037854 #18 Jan 19 2018 15:21:35
%S A037854 0,0,0,1,0,0,0,2,1,0,0,3,2,1,0,1,1,1,1,1,0,0,0,2,1,0,0,3,2,1,0,2,2,2,
%T A037854 2,2,1,1,1,2,1,0,0,3,2,1,0,3,3,3,3,3,2,2,2,3,2,1,1,3,2,1,0,1,1,1,1,2,
%U A037854 1,1,1,3,2,1,1,4,3,2,1,1,1,1,1,1,0,0,0,2,1,0
%N A037854 Sum_{i=1..m, d(i)>d(i-1)} d(i)-d(i-1), where Sum_{i=0..m} d(i)*4^i is the base 4 representation of n.
%C A037854 This is the base-4 down-variation sequence; see A297330. - _Clark Kimberling_, Jan 18 2018
%H A037854 Clark Kimberling, <a href="/A037854/b037854.txt">Table of n, a(n) for n = 1..10000</a>
%p A037854 A037854 := proc(n)
%p A037854     a := 0 ;
%p A037854     dgs := convert(n,base,4);
%p A037854     for i from 2 to nops(dgs) do
%p A037854         if op(i,dgs)>op(i-1,dgs) then
%p A037854             a := a+op(i,dgs)-op(i-1,dgs) ;
%p A037854         end if;
%p A037854     end do:
%p A037854     a ;
%p A037854 end proc: # _R. J. Mathar_, Oct 19 2015
%t A037854 d[n_] := d[n] = Differences[RealDigits[n, 4][[1]]]
%t A037854 Table[Total[Select[d[n], # > 0 &]], {n, 1, z}];  (* A037845 *)
%t A037854 -Table[Total[Select[d[n], # < 0 &]], {n, 1, z}]; (* A037854 *)
%t A037854 (* _Clark Kimberling_, Oct 20 2015 *)
%Y A037854 Cf. A297330.
%K A037854 nonn,base
%O A037854 1,8
%A A037854 _Clark Kimberling_
%E A037854 Definition swapped with A037845 by _R. J. Mathar_, Oct 19 2015