The Thue-Morse sequence \(t_0,t_1,\ldots\) is generated by

$$\prod_{i=0}^\infty (1-x^{2^i})=\sum_{j=0}^\infty(-1)^{t_j}x^j$$

We can compute \(t_0,t_1,\ldots,t_{15}\) (say) by considering the product

$$(1+x)(1+x^2)(1+x^4)(1+x^8)$$

since higher powers will not contribute.

In J:

_1 1 0 0 0 0 0 0 0
_1 0 1 0 0 0 0 0 0
_1 0 0 0 1 0 0 0 0
_1 0 0 0 0 0 0 0 1

which we can create with

{{ _1,(]0"0 i.y),1 }}"0 (0 1 3 7)

or more generically

N=:15
({{ _1,(]0"0 i.y),1 }})"0 {{<:2^y}}"0 i.# #:N

With the idiom pmul=:+//.@(*/):

   N=:15
   N {. _1^.pmul/({{ _1,(]0"0 i.y),1 }})"0 {{<:2^y}}"0 i.# #:N
0 1 1 0 1 0 0 1 1 0 0 1 0 1 1

where we take logarithms base \(-1\) to recover \(t_j\).