|
|
A350093
|
|
a(n) = Sum_{k=0..n} n OR k where OR is the bitwise logical OR operator (A003986).
|
|
4
|
|
|
0, 2, 7, 12, 26, 34, 45, 56, 100, 114, 131, 148, 174, 194, 217, 240, 392, 418, 447, 476, 514, 546, 581, 616, 684, 722, 763, 804, 854, 898, 945, 992, 1552, 1602, 1655, 1708, 1770, 1826, 1885, 1944, 2036, 2098, 2163, 2228, 2302, 2370, 2441, 2512, 2712, 2786, 2863
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
The effect of n OR k is to force a 1-bit at all bit positions where n has a 1-bit, which means n*(n+1) in the sum. Bits of k where n has a 0-bit are NOT(n) AND k = n CNIMPL k so that a(n) = A350094(n) + n*(n+1).
|
|
LINKS
|
|
|
FORMULA
|
a(n) = ((3*n+2)*n + A001196(n)) / 4.
a(2*n) = 4*a(n) - n.
a(2*n+1) = 4*a(n) + 2*n + 2.
|
|
PROG
|
(PARI) a(n) = (3*(n^2 + fromdigits(binary(n), 4)) + 2*n) >> 2;
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,easy,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|