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.

A037837 a(n) = Sum{|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.

This page as a plain text file.
%I A037837 #12 Jan 20 2018 12:38:14
%S A037837 0,0,0,0,1,0,1,2,3,2,1,0,1,2,3,2,1,0,1,4,3,2,1,0,1,2,3,4,5,1,0,1,2,3,
%T A037837 3,2,1,2,3,5,4,3,2,3,7,6,5,4,3,2,3,4,5,6,2,1,2,3,4,2,1,0,1,2,4,3,2,1,
%U A037837 2,6,5,4,3,2,3,4,5,6,7,3,2,3,4,5,3,2,1,2,3,3
%N A037837 a(n) = Sum{|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 A037837 This is the base-5 total variation sequence; see A297330. - _Clark Kimberling_, Jan 18 2017
%H A037837 Clark Kimberling, <a href="/A037837/b037837.txt">Table of n, a(n) for n = 1..10000</a>
%p A037837 A037837 := proc(n)
%p A037837     local dgs ;
%p A037837     dgs := convert(n,base,5);
%p A037837     add( abs(op(i,dgs)-op(i-1,dgs)),i=2..nops(dgs)) ;
%p A037837 end proc: # _R. J. Mathar_, Oct 16 2015
%t A037837 b = 5; z = 120; t = Table[Total@Flatten@Map[Abs@Differences@# &, Partition[IntegerDigits[n, b], 2, 1]], {n, z}] (* cf. Michael De Vlieger, A037834 *)
%Y A037837 Cf. A297330.
%K A037837 nonn,base
%O A037837 1,8
%A A037837 _Clark Kimberling_
%E A037837 Updated by _Clark Kimberling_, Jan 20 2018