login
First put a(n)=0 for all n, then start with a(0) = 1 and add at step n >= 0 the term 1 at position 2*n + a(n).
4

%I #20 Mar 11 2021 07:27:19

%S 1,1,0,1,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,0,1,

%T 1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,

%U 0,1,1,0,0,1,1,0,1,0,0,1,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,0,1,1,0,1,0,0,1,1,0,0,1,0,1,1,0,1,0,0,1,0,1,1,0,0

%N First put a(n)=0 for all n, then start with a(0) = 1 and add at step n >= 0 the term 1 at position 2*n + a(n).

%C Sum_{i = 0..n} a(i)/n tends to 1/2 as n tends to infinity. [corrected by _Rémy Sigrist_, Jan 31 2018]

%C From _Michel Dekking_, Sep 07 2020: (Start)

%C The above limit statement follows from a much stronger property.

%C Let mu be the 'exchanged' Thue-Morse morphism given by

%C mu(0) = 10, mu(1) = 01.

%C CLAIM: a(234...) = mu(a(123...)).

%C Here a(234...) denotes the word associated to the sequence a(2), a(3), a(4),....

%C Proof: If a(n)=1 then a(2n+1)=1, and it also follows that a(2n)=0. If a(n)=0 then a(2n)=1, and it also follows that a(2n+1)=0.

%C This can also be expressed as mu(a(n))=a(2n)a(2n+1).

%C (End)

%e Set a(n) = 0.

%e n = 0, a(0) = 1. Add term 1 at position 2*0+1 = 1. We have {1,1,0,0,0,0,0,0,0,0,...}

%e n = 1, a(1) = 1. Add term 1 at position 2*1+1 = 3. We have {1,1,0,1,0,0,0,0,0,0,...}

%e n = 2, a(2) = 0. Add term 1 at position 2*2+0 = 4. We have {1,1,0,1,1,0,0,0,0,0,...}

%e n = 3, a(3) = 1. Add term 1 at position 2*3+1 = 7. We have {1,1,0,1,1,0,0,1,0,0,...}

%e and so on.

%o (PARI) a(n) = if(n==0,1, (logint(n,2) - hammingweight(n)) % 2); \\ _Kevin Ryde_, Mar 11 2021

%Y Cf. A059448 (complement), A242179 (values +-1).

%Y Indices of 0's and 1's (except n=0): A059009, A059010.

%Y Cf. A298307.

%K nonn

%O 0

%A _Ctibor O. Zizka_, Jan 30 2018