login
A328564
a(n) is the sum of the elements of the set A_n = {(n-k) AND k, k = 0..n} (where AND denotes the bitwise AND operator).
4
0, 0, 0, 1, 0, 3, 2, 4, 0, 7, 6, 13, 4, 14, 8, 11, 0, 15, 14, 30, 12, 41, 26, 39, 8, 38, 28, 49, 16, 41, 22, 26, 0, 31, 30, 63, 28, 92, 60, 91, 24, 109, 82, 142, 52, 135, 78, 101, 16, 94, 76, 139, 56, 159, 98, 138, 32, 117, 82, 133, 44, 100, 52, 57, 0, 63, 62
OFFSET
-1,6
COMMENTS
The number of elements of the set A_n appears to be A002487(n+1); a(-1) = 0 as A_{-1} is the empty set.
Row sums of A326819.
FORMULA
a(n) <= A006581(n).
Apparently, a(n) + A328565(n) = A328566(n).
MAPLE
a:= n-> add(i, i={seq(Bits[And](n-k, k), k=0..n)}):
seq(a(n), n=-1..80); # Alois P. Heinz, Oct 20 2019
PROG
(PARI) a(n) = vecsum(Set(apply(k -> bitand(k, n-k), [0..n])))
(Python)
def A328564(n): return sum(set(k&n-k for k in range((n>>1)+1))) # Chai Wah Wu, May 07 2023
CROSSREFS
Cf. A328565 (XOR variant), A328566 (OR variant).
Sequence in context: A004545 A127481 A284552 * A154879 A097673 A226377
KEYWORD
nonn,look,base
AUTHOR
Rémy Sigrist, Oct 20 2019
STATUS
approved