login
A037836
a(n) = Sum{|d(i)-d(i-1)|: i=1,...,m}, where Sum{d(i)*4^i: i=0,1,...,m} is the base 4 representation of n.
2
0, 0, 0, 1, 0, 1, 2, 2, 1, 0, 1, 3, 2, 1, 0, 1, 2, 3, 4, 1, 0, 1, 2, 3, 2, 1, 2, 5, 4, 3, 2, 2, 3, 4, 5, 2, 1, 2, 3, 2, 1, 0, 1, 4, 3, 2, 1, 3, 4, 5, 6, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 0, 1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, 4, 7, 6, 5, 4, 1, 2, 3, 4, 1, 0, 1, 2, 3, 2, 1
OFFSET
1,7
COMMENTS
This is the base-4 total variation sequence; see A297330. - Clark Kimberling, Jan 18 2017
LINKS
MAPLE
A037836 := proc(n)
local dgs ;
dgs := convert(n, base, 4);
add( abs(op(i, dgs)-op(i-1, dgs)), i=2..nops(dgs)) ;
end proc: # R. J. Mathar, Oct 16 2015
MATHEMATICA
b = 4; z = 120; t = Table[Total@Flatten@Map[Abs@Differences@# &, Partition[IntegerDigits[n, b], 2, 1]], {n, z}] (* cf. Michael De Vlieger, A037834 *)
CROSSREFS
Cf. A297330.
Sequence in context: A109246 A037890 A037898 * A194522 A165013 A351995
KEYWORD
nonn,base
EXTENSIONS
Updated by Clark Kimberling, Jan 20 2018
STATUS
approved