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.

A037846 a(n)=Sum{d(i-1)-d(i): d(i) where Sum{d(i)*5^i: i=0,1,...,m} is the base 5 representation of n.

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