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