|
|
A093150
|
|
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
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
Zeros occur at 9*j.
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.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
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}]
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|