OFFSET
0,5
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
FORMULA
If n is even, a(n) = n/2; if n is odd, a(n) = A066568(floor(n/2)). - Michel Marcus, Aug 14 2013
EXAMPLE
a(0) = 0, a(1) = 0 - 0 = 0.
a(2) = 1, a(3) = 1 - 1 = 0.
a(4) = 2, a(5) = 2 - 2 = 0.
a(6) = 3, a(7) = 3 - 3 = 0.
MATHEMATICA
Table[{n, n-Total[IntegerDigits[n]]}, {n, 0, 40}]//Flatten (* Harvey P. Dale, Nov 26 2016 *)
PROG
(PARI) a(n) = if (n % 2 == 0, n/2, nn = n\2; d = digits(nn); nn - sum(i=1, #d, d[i]); ); \\ Michel Marcus, Aug 14 2013
CROSSREFS
KEYWORD
easy,nonn,base
AUTHOR
Marcel Hetkowski Fabeny (marcelfabeny(AT)yahoo.com.br), Dec 04 2009
EXTENSIONS
Edited by N. J. A. Sloane, Dec 05 2009
STATUS
approved