The Thue–Morse sequence[$^{[1]}$](http://en.wikipedia.org/wiki/Thue%E2%80%93Morse_sequence)[$\!^{[2]}$](http://mathworld.wolfram.com/Thue-MorseSequence.html) $t\_n$ is an infinite binary sequence constructed by starting with $t\_0=0$ and successively appending the binary complement of the sequence obtained so far:
$$\begin{array}l
0\\
0&\color{red}1\\
0&1&\color{red}1&\color{red}0\\
0&1&1&0&\color{red}1&\color{red}0&\color{red}0&\color{red}1\\
0&1&1&0&1&0&0&1&\color{red}1&\color{red}0&\color{red}0&\color{red}1&\color{red}0&\color{red}1&\color{red}1&\color{red}0\\
\hline
0&1&1&0&1&0&0&1&1&0&0&1&0&1&1&0&1&0&0&1&0&1&1&\dots\\
t\_0&t\_1&t\_2&t\_3&t\_4&\dots\!\!\!
\end{array}$$

It has many interesting properties: it is aperiodic, cube-free, shows the parity of the number of $1$'s in the binary representation of a natural number, has connections to the [Fabius function](http://en.wikipedia.org/wiki/Fabius_function), the hypergeometric function, etc.

There is a nice formula for this sequence that uses only elementary functions, binomial coefficients and finite summation:
$$t\_n=\frac43\,\sin^2\left(\frac\pi3\left(n-\sum\_{k=1}^n(-1)^{\binom n k}\right)\right)=\operatorname{mod}\left(2n+\sum\_{k=1}^n(-1)^{\binom n k},\,3\right).$$
Unfortunately, I could not find a proof of this formula anywhere and could not construct it myself. So, I'm asking for your help with this.