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.
%I A037858 #11 Jan 19 2018 19:36:30 %S A037858 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,3,2,1,0,0,0,0,0,4,3,2, %T A037858 1,0,0,0,0,5,4,3,2,1,0,0,0,6,5,4,3,2,1,0,0,7,6,5,4,3,2,1,0,1,1,1,1,1, %U A037858 1,1,1,1,0,0,0,0,0,0,0,2,1,0,0,0,0,0,0,3,2,1 %N A037858 Sum{d(i)-d(i-1): d(i)>d(i-1), i=1,...,m}, where Sum{d(i)*8^i: i=0,1,...,m} is base 8 representation of n. %C A037858 This is the base-8 down-variation sequence; see A297330. %H A037858 Clark Kimberling, <a href="/A037858/b037858.txt">Table of n, a(n) for n = 1..10000</a> %p A037858 A037858 := proc(n) %p A037858 a := 0 ; %p A037858 dgs := convert(n,base,8); %p A037858 for i from 2 to nops(dgs) do %p A037858 if op(i,dgs)>op(i-1,dgs) then %p A037858 a := a+op(i,dgs)-op(i-1,dgs) ; %p A037858 end if; %p A037858 end do: %p A037858 a ; %p A037858 end proc: # _R. J. Mathar_, Oct 19 2015 %t A037858 g[n_, b_] := Differences[IntegerDigits[n, b]]; b = 8; z = 120; %t A037858 Table[-Total[Select[g[n, b], # < 0 &]], {n, 1, z}]; (*A037858*) %t A037858 Table[Total[Select[g[n, b], # > 0 &]], {n, 1, z}]; (*A037849*) %Y A037858 Cf. A297330. %K A037858 nonn,base %O A037858 1,16 %A A037858 _Clark Kimberling_ %E A037858 Definition swapped with A037849. - _R. J. Mathar_, Oct 19 2015 %E A037858 Updated by _Clark Kimberling_, Jan 19 2018