OFFSET
1,2
LINKS
Michel Marcus, Table of n, a(n) for n = 1..10000
MATHEMATICA
Table[Total[Select[IntegerDigits[n], OddQ]]-Total[Select[ IntegerDigits[ n], EvenQ]], {n, 80}] (* Harvey P. Dale, Jul 27 2020 *)
PROG
(PARI) a(n) = {my(d=digits(n), s = 0); for (k=1, #d, if (d[k] % 2, s += d[k], s -= d[k]); ); s; } \\ Michel Marcus, Aug 05 2017
(PARI) A071650(n)=-vecsum(apply(t->(-1)^t*t, digits(n))) \\ M. F. Hasler, Dec 09 2018
CROSSREFS
KEYWORD
AUTHOR
Reinhard Zumkeller, May 28 2002
STATUS
approved