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.

A037853 Sum{d(i)-d(i-1): d(i)>d(i-1), i=1,...,m}, where Sum{d(i)*3^i: i=0,1,...,m} is base 3 representation of n.

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