login
A336033
a(n) is the number of k such that 1 <= k < n and a(k) XOR ... XOR a(n-1) = 0 (where XOR denotes the bitwise XOR operator).
4
0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 3, 2, 2, 3, 4, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 3, 2, 2, 3, 4, 5, 3, 3, 4, 3, 3, 4, 5, 6, 4, 4, 5, 4, 4, 5, 6, 7, 5, 5, 6, 5, 5, 6, 7, 8, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 3, 2, 2, 3, 4, 0, 1, 0, 1, 2, 0, 1, 0, 1, 2, 3, 2, 2, 3, 4, 5, 3
OFFSET
1,5
COMMENTS
This sequence has fractal features; each time the sequence hits a new power of 2, say a(m) = 2^k for the first time, then a(m + i) = a(i) for i = 1..m and a(2*m + 1) = 1 + a(m).
These are (a strong conjecture) the "y" values from A340488. - Rémy Sigrist, Jan 11 2021
LINKS
EXAMPLE
The first terms, alongside the corresponding k's, are:
n a(n) k's
-- ---- -------
1 0 {}
2 1 {1}
3 0 {}
4 1 {3}
5 2 {1, 2}
6 0 {}
7 1 {6}
8 0 {}
9 1 {8}
10 2 {6, 7}
11 3 {1, 2, 5}
12 2 {8, 9}
PROG
(PARI) for (n=1, #a=vector(87), x=0; forstep (k=n-1, 1, -1, if (0==x=bitxor(x, a[k]), a[n]=1+a[k]; break)); print1 (a[n] ", "))
CROSSREFS
Sequence in context: A071482 A071483 A340499 * A238405 A374398 A004173
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Jul 07 2020
STATUS
approved