A037841 a(n)=Sum{|d(i)-d(i-1)|: i=1,...,m}, where Sum{d(i)*9^i: i=0,1,...,m} is the base 9 representation of n.
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2, 3, 4, 5, 6, 7, 2, 1, 0, 1, 2, 3, 4, 5, 6, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0, 1, 2, 3, 6, 5, 4, 3, 2, 1, 0, 1, 2, 7, 6, 5, 4, 3, 2, 1, 0, 1, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1
Offset: 1
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
Crossrefs
Cf. A297330.
Programs
-
Mathematica
b = 9; z = 120; t = Table[Total@ Flatten@ Map[Abs@ Differences@ # &, Partition[IntegerDigits[n, b], 2, 1]], {n, z}] (* cf. Michael De Vlieger, A037834 *)
Extensions
Updated by Clark Kimberling, Jan 20 2018
Comments