OFFSET
0,3
COMMENTS
- starts with zero or more occurrences of "10",
- followed by a "0" when the binary expansion of a(n) starts with zero or more occurrences of "10" followed by "11",
- ends with the binary expansion of a(n) (assuming that 0 has an empty binary expansion).
EXAMPLE
The first terms, alongside the binary expansions of A032766(n) and a(n), are:
n a(n) bin(A032766(n)) bin(a(n))
-- ---- --------------- ---------
0 1 0 1
1 0 1 0
2 4 11 100
3 9 100 1001
4 3 110 11
5 8 111 1000
6 18 1001 10010
7 7 1010 111
8 17 1100 10001
9 6 1101 110
10 16 1111 10000
11 37 10000 100101
PROG
(PARI) a(n) = { if (n<=1, return (1-n), n+=n\2; for (x=2+exponent(n), oo, my (k=bitneg(n, x)); if (k%3==0, return (k/3)))) }
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Dec 23 2022
STATUS
approved