%I #25 Dec 05 2022 04:47:12
%S 1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,
%T 1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,
%U 0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0,1
%N a(0)=1; for n>0, a(n) = (1-a(floor(log_2(n)))) * a(n-msb(n)); characteristic function of A079599.
%C This is NOT the leftmost column of A125999, as here a(2^64) = 0, while X_A126002(2^64) = 1.
%H Antti Karttunen, <a href="/A236677/b236677.txt">Table of n, a(n) for n = 0..8192</a>
%F a(0) = 1 and for n > 0, a(n) = (1-a(A000523(n))) * a(A053645(n)) [where A000523 gives the bit-index of the most significant bit of n (msb), and A053645 gives n without its msb].
%F For all n, a(n) * A034798(n) = 0 (as ones in this sequence occur at the positions where zeros are in A034798).
%o (Scheme, with _Antti Karttunen_'s IntSeq-library for memoizing definec-macro, two alternative implementations)
%o (definec (A236677 n) (if (zero? n) 1 (* (- 1 (A236677 (A000523 n))) (A236677 (A053645 n)))))
%o (definec (A236677 n) (let loop ((n n) (i 0)) (cond ((zero? n) 1) ((odd? n) (if (= 1 (A236677 i)) 0 (loop (/ (- n 1) 2) (+ i 1)))) (else (loop (/ n 2) (+ i 1))))))
%Y A236678 gives the partial sums. Differs from the characteristic function of A047467 for the first at n=256, as here a(256)=0, while X_A047467(256)=1 because 256 = 0 modulo 8.
%Y Cf. A079599, A034798.
%K nonn
%O 0
%A _Antti Karttunen_, Jan 29 2014
%E Incorrect formula removed by _Georg Fischer_, Dec 02 2022