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).
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
Examples
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}
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
Programs
-
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] ", "))
Comments