login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,5
LINKS
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
CROSSREFS
Sequence in context: A292836 A240116 A007768 * A011371 A325123 A097355
KEYWORD
base,sign
AUTHOR
Reinhard Zumkeller, Aug 06 2010
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 14:38 EDT 2024. Contains 371254 sequences. (Running on oeis4.)