|
|
A328565
|
|
a(n) is the sum of the elements of the set X_n = {(n-k) XOR k, k = 0..n} (where XOR denotes the bitwise XOR operator).
|
|
4
|
|
|
0, 0, 1, 2, 3, 6, 6, 10, 7, 18, 15, 24, 14, 32, 23, 34, 15, 50, 40, 66, 33, 78, 53, 76, 30, 92, 69, 110, 49, 114, 72, 98, 31, 130, 105, 180, 84, 212, 139, 198, 69, 222, 164, 262, 111, 258, 159, 212, 62, 244, 191, 322, 143, 358, 228, 318, 101, 326, 235, 372, 148
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
-1,4
|
|
COMMENTS
|
The number of elements of the set X_n appears to be A002487(n+1); a(-1) = 0 as X_{-1} is the empty set.
|
|
LINKS
|
|
|
FORMULA
|
|
|
MAPLE
|
a:= n-> add(i, i={seq(Bits[Xor](n-k, k), k=0..n)}):
|
|
PROG
|
(PARI) a(n) = vecsum(Set(apply(k -> bitxor(k, n-k), [0..n])))
(Python)
def A328565(n): return sum(set(k^n-k for k in range((n>>1)+1))) # Chai Wah Wu, May 07 2023
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|