login
A180018
Difference of sums of digits of n in decimal and in binary representation.
5
0, 0, 1, 1, 3, 3, 4, 4, 7, 7, -1, -1, 1, 1, 2, 2, 6, 6, 7, 7, 0, 0, 1, 1, 4, 4, 5, 5, 7, 7, -1, -1, 4, 4, 5, 5, 7, 7, 8, 8, 2, 2, 3, 3, 5, 5, 6, 6, 10, 10, 2, 2, 4, 4, 5, 5, 8, 8, 9, 9, 2, 2, 3, 3, 9, 9, 10, 10, 12, 12, 4, 4, 7, 7, 8, 8, 10, 10, 11, 11, 6, 6, 7, 7, 9, 9, 10, 10, 13, 13, 5, 5, 7, 7, 8, 8
OFFSET
0,5
FORMULA
a(n) = A007953(n) - A000120(n);
a(A037308(n)) = 0;
a(A011557(n)) = 1 - A000120(A011557(n));
a(A000079(n)) = A007953(A000079(n)) - 1;
a(A002283(n)) = A008591(n) - A000120(A002283(n));
a(A000225(n)) = A007953(A000225(n)) - n.
MATHEMATICA
Table[Total[IntegerDigits[n]]-Total[IntegerDigits[n, 2]], {n, 0, 100}] (* Harvey P. Dale, Dec 27 2015 *)
PROG
(PARI) a(n) = sumdigits(n) - hammingweight(n); \\ Michel Marcus, Nov 06 2022
KEYWORD
base,sign
AUTHOR
Reinhard Zumkeller, Aug 06 2010
STATUS
approved