login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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.
Row sums of A328568.
LINKS
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
Cf. A328564 (AND variant), A328566 (OR variant).
Sequence in context: A039799 A185423 A144583 * A308762 A155215 A363075
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Oct 20 2019
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 18 20:26 EDT 2024. Contains 371781 sequences. (Running on oeis4.)