TITLE: Is there a formula for the pattern $1,1,1,0,1,0,1,0,1,0\ldots$? Or a mathematical principle?
QUESTION [5 upvotes]: Starting from $n= 0$:
$1,1,1,0,1,0,1,0,1,0\ldots$
The $0,1,0,1$ pattern keeps on going. Is there a formula for this?

REPLY [2 votes]: The formula of the sequence is
$$a_n=\begin{cases}
0, &\text{ if }n \text{ is odd and }n \neq 1 \\
1,&\text{ if }n \text{ is even or } n=1 \end{cases}.
$$
That's all. There is no simpler formula. You could replace "$\text{if }n \text{ is even or } n=1$" by "$\text{otherwise}$", if you prefer that notation. Trying to write this without a case split makes things unnecessary complicated. Interpreting the sequence as digits of a number, as some answers do, only makes sense if you know that the sequence actually represents digits of a number. The pattern is simply too basic to have a deeper meaning.