|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
a:= n-> add(i, i={seq(Bits[And](n-k, k), k=0..n)}):
|
|
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
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|