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
Winston de Greef, Table of n, a(n) for n = 0..10000
FORMULA
PROG
(PARI) a(n) = (3*(n^2 + fromdigits(binary(n), 4)) + 2*n) >> 2;
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Kevin Ryde, Dec 14 2021
STATUS
approved