|
|
A304439
|
|
Add to n the sum of its odd digits minus the sum of its even digits.
|
|
5
|
|
|
0, 2, 0, 6, 0, 10, 0, 14, 0, 18, 11, 13, 11, 17, 11, 21, 11, 25, 11, 29, 18, 20, 18, 24, 18, 28, 18, 32, 18, 36, 33, 35, 33, 39, 33, 43, 33, 47, 33, 51, 36, 38, 36, 42, 36, 46, 36, 50, 36, 54, 55, 57, 55, 61, 55, 65, 55, 69, 55, 73, 54, 56, 54, 60, 54, 64, 54, 68, 54, 72
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Subsequence A036301 lists fixed points of this map, the first nontrivial one being 112. It is a subsequence of A124176 (and A124177) which considers iterations of this map, more precisely, numbers which are in a cyclic orbit for iterations of this map.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
soded[n_]:=Module[{idn=IntegerDigits[n]}, n+Total[Select[idn, OddQ]]-Total[ Select[idn, EvenQ]]]; Array[soded, 70, 0] (* Harvey P. Dale, Aug 12 2021 *)
|
|
PROG
|
(PARI) A304439(n)=n-vecsum(apply(t->t*(-1)^t, digits(n)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|