|
|
A304440
|
|
Add to n the sum of its even digits minus the sum of its odd digits.
|
|
4
|
|
|
0, 0, 4, 0, 8, 0, 12, 0, 16, 0, 9, 9, 13, 9, 17, 9, 21, 9, 25, 9, 22, 22, 26, 22, 30, 22, 34, 22, 38, 22, 27, 27, 31, 27, 35, 27, 39, 27, 43, 27, 44, 44, 48, 44, 52, 44, 56, 44, 60, 44, 45, 45, 49, 45, 53, 45, 57, 45, 61, 45, 66, 66, 70, 66, 74, 66, 78, 66, 82, 66, 63
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
A036301 lists fixed points of this map, the first nonzero one being 112. It is also a subsequence of A124177 (and A124176) which lists numbers which are in a cyclic orbit under iterations of this map.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MATHEMATICA
|
nseo[n_]:=Module[{idn=IntegerDigits[n]}, n+Total[Select[idn, EvenQ]]-Total[Select[idn, OddQ]]]; Array[nseo, 80, 0] (* Harvey P. Dale, Dec 26 2023 *)
|
|
PROG
|
(PARI) A304440(n)=n+vecsum(apply(t->t*(-1)^t, digits(n)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|