OFFSET
0,5
COMMENTS
All terms can be written as m * 2^A000120(m) for some m >= 0.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..8191
Rémy Sigrist, Colored logarithmic scatterplot of the sequence for n < 2^16 (where the color is function of A080791(n))
FORMULA
EXAMPLE
For n = 4:
- 4 AND 0 = 0,
- 4 AND 1 = 0,
- 4 AND 2 = 0,
- 4 AND 3 = 0,
- 4 AND 4 = 4,
- so a(4) = 0 + 1 + 2 + 3 = 6.
PROG
(PARI) a(n) = sum(k=0, n, if (bitand(n, k)==0, k, 0))
(PARI) a(n) = my (w=#binary(n)); ( (2^w-1-n) * 2^(w-hammingweight(n)) ) \ 2
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 21 2021
STATUS
approved