login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A236677
a(0)=1; for n>0, a(n) = (1-a(floor(log_2(n)))) * a(n-msb(n)); characteristic function of A079599.
3
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, 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, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1
OFFSET
0
COMMENTS
This is NOT the leftmost column of A125999, as here a(2^64) = 0, while X_A126002(2^64) = 1.
LINKS
FORMULA
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].
For all n, a(n) * A034798(n) = 0 (as ones in this sequence occur at the positions where zeros are in A034798).
PROG
(Scheme, with Antti Karttunen's IntSeq-library for memoizing definec-macro, two alternative implementations)
(definec (A236677 n) (if (zero? n) 1 (* (- 1 (A236677 (A000523 n))) (A236677 (A053645 n)))))
(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))))))
CROSSREFS
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.
Sequence in context: A154271 A225569 A087032 * A190236 A190224 A352678
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 29 2014
EXTENSIONS
Incorrect formula removed by Georg Fischer, Dec 02 2022
STATUS
approved