OFFSET
1,6
COMMENTS
This is the base-3 total variation sequence; see A297330. - Clark Kimberling
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..10000
MAPLE
A037835 := proc(n)
local dgs ;
dgs := convert(n, base, 3);
add( abs(op(i, dgs)-op(i-1, dgs)), i=2..nops(dgs)) ;
end proc: # R. J. Mathar, Oct 16 2015
MATHEMATICA
b = 3; z = 120; t = Table[Total@Flatten@Map[Abs@Differences@# &, Partition[IntegerDigits[n, b], 2, 1]], {n, z}] (* cf. Michael De Vlieger, A037834 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Updated by Clark Kimberling, Jan 19 2018
STATUS
approved