[go: up one dir, main page]

login
A292601
a(n) = n - A292600(n).
3
0, 1, 1, 2, 1, 2, 4, 5, 1, 2, 4, 5, 8, 9, 9, 10, 1, 2, 4, 5, 8, 9, 9, 10, 16, 17, 17, 18, 17, 18, 20, 21, 1, 2, 4, 5, 8, 9, 9, 10, 16, 17, 17, 18, 17, 18, 20, 21, 32, 33, 33, 34, 33, 34, 36, 37, 33, 34, 36, 37, 40, 41, 41, 42, 1, 2, 4, 5, 8, 9, 9, 10, 16, 17, 17, 18, 17, 18, 20, 21, 32, 33, 33, 34, 33, 34, 36, 37, 33, 34, 36, 37, 40, 41, 41, 42, 64, 65, 65
OFFSET
0,4
FORMULA
a(n) = n - A292600(n) = n - A006068(floor(n/2)).
MATHEMATICA
Table[n - If[n < 2, 0, BitXor @@ Table[Floor[#/2^m], {m, 0, Floor@ Log2@ #}] &@ Floor[n/2]], {n, 0, 98}] (* Michael De Vlieger, Sep 21 2017 *)
PROG
(Python)
def A292601(n):
k, m = n>>1, n>>2
while m > 0:
k ^= m
m >>= 1
return n-k # Chai Wah Wu, Jun 30 2022
CROSSREFS
Sequence in context: A319773 A256188 A072727 * A301364 A309503 A057061
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 21 2017
STATUS
approved