login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
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.
FORMULA
a(n) = n - A071650(n).
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
Cf. A304439 (variant: + even - odd digits), A071650 (odd - even digits), A071648, A071649, A036301 (fixed points), A124177, A124176.
Sequence in context: A070802 A114401 A378617 * A073467 A288096 A021249
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, May 18 2018
STATUS
approved