OFFSET
1,2
COMMENTS
If a zero term were to arise, we would consider it to have 1 bit.
EXAMPLE
After a(1) = 1, since it is odd, we add the total number of bits so far, to get a(2) = 1 + 1 = 2.
After a(2) = 2, since it is even, we subtract the total number of (not necessarily nonzero) bits so far (#"1" = 1, #"10" = 2), to get a(3) = 2 - 3 = -1.
Since a(3) = -1 is odd, we add #"1" = 1, #"10" = 2 and #"1" = 1, to get a(4) = -1 + 4 = 3.
PROG
(PARI) ({A332064_vec(N, a=1, s=-a)=vector(N, n, a-=(-1)^a*s+=exponent(a+!a)+1)})(50)
CROSSREFS
KEYWORD
sign
AUTHOR
M. F. Hasler, Feb 27 2020
STATUS
approved