OFFSET
-1,4
COMMENTS
LINKS
Rémy Sigrist, Table of n, a(n) for n = -1..8192
FORMULA
a(n) <= n + A006582(n) for n >= 2.
MAPLE
a:= n-> add(i, i={seq(Bits[Xor](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 -> 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
Rémy Sigrist, Oct 20 2019
STATUS
approved