login
Add to n the sum of its odd digits minus the sum of its even digits.
5

%I #6 Aug 12 2021 11:04:48

%S 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,

%T 28,18,32,18,36,33,35,33,39,33,43,33,47,33,51,36,38,36,42,36,46,36,50,

%U 36,54,55,57,55,61,55,65,55,69,55,73,54,56,54,60,54,64,54,68,54,72

%N Add to n the sum of its odd digits minus the sum of its even digits.

%C 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.

%F a(n) = n + A071650(n).

%t 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 *)

%o (PARI) A304439(n)=n-vecsum(apply(t->t*(-1)^t,digits(n)))

%Y Cf. A304440, A071650, A071648, A071649, A036301, A124176, A124177.

%K nonn,base

%O 0,2

%A _M. F. Hasler_, May 18 2018