b(n) = my(A = n); for(i = 1, hammingweight(n) - 1, A++; A >>= 1 - valuation(A, 2)); A
f1(n) = if(n == 1, 2, my(A = solve(r=0, 1, r*(2 - r + r^2)-1)); ceil(log((19*A - A^2 + 11*A^3)/(23*n))/log(A)))
f2(n) = if(n == 1, 2, my(A = solve(r=0, 1, r*(2 - r + r^2)-1)); ceil(log((48*A - 11*A^2 + 29*A^3)/(23*(n+1)23*n))/log(A)))
c(n) = my(v1); v1 = vector(f1(n)+1, i, 0); v1[2] = 1; v1[3] = 2; for(i = 4, #v1, v1[i] = 2*v1[i-1] - v1[i-2] + v1[i-3]); v2 = v1; for(i = 2, #v1, v2[i] += v2[i-1]); my(b1(n) = my(A = f1(n) + 1); A - (v1[A]>n), b2(n) = my(A = f2(n) + 1); A - (v2[A]>n), A = 0, B = 0, C); while(n > 2, if(!(B%2), C = b2(n-2); n -= v2[C] + 1; A += 1 << (B/2 + C - 1), C = b1(n-1); n -= v1[C]; A += 1 << ((B-1)/2 + C - 2)); B++); A + n
a(n) = my(A = 2, v1); v1 = [0, 1]; while(#v1<n, v1 = concat(v1, if(v1[A]==2, [0], [v1[A], v1[A]+1])); A++); v1[n]
a1(n) = if(n == 1, 0, my(A = b(c(n))); if(A == b(c(n-1))/2, 2, valuation(A, 2)%2))
test(n) = a(n) == a1(n)
It looks like that for $\operatorname{wt}(n)+2k-1, k\geqslant 0$ iterations similar conjectures are equivalent. Also, for $\operatorname{wt}(n)+2k, k\geqslant$ we have similar conjectures which are also equivalent to each other, but here we get A287066 instead of $a(n)$.