login
Absolute value of difference between (sum of digits of n if n odd, otherwise sum of digits of 2n) and (sum of digits of n if n even, otherwise sum of digits of 2n).
2

%I #2 Mar 30 2012 17:31:00

%S 0,1,2,3,4,4,3,2,1,0,1,2,3,4,5,3,2,1,0,1,2,3,4,5,6,2,1,0,1,2,3,4,5,6,

%T 7,1,0,1,2,3,4,5,6,7,8,0,1,2,3,4,4,3,2,1,0,8,7,6,5,4,3,2,1,0,1,7,6,5,

%U 4,3,2,1,0,1,2,6,5,4,3,2,1,0,1,2,3,5,4,3,2,1,0,1,2,3,4,4,3,2,1,0,1,2,3,4,5

%N Absolute value of difference between (sum of digits of n if n odd, otherwise sum of digits of 2n) and (sum of digits of n if n even, otherwise sum of digits of 2n).

%C Zeros occur at 9*j.

%C First occurrence of k: 0,1,2,3,4,14,24,34,44,144,244,344,444,1444,2444,3444,4444,14444,24444,34444,44444,144444,244444,344444,444444, etc.

%F a(n) = | A092383(n) - A092384(n) |.

%t f[n_] := Plus @@ IntegerDigits[ If[ OddQ[n], n, 2n]]; g[n_] := Plus @@ IntegerDigits[ If[ EvenQ[n], n, 2n]]; Table[ Abs[ f[n] - g[n]], {n, 0, 104}]

%Y Cf. A092383, A092384.

%K base,easy,nonn

%O 0,3

%A _Robert G. Wilson v_, Mar 24 2004