(function c(i){for(m=[0],q=0;q*2<i;q++){m[2*q]=m[q];m[2*q+1]=1-m[q]}console.log(m.slice(0,i))})(6);
Standard input is empty
[ 0, 1, 1, 0, 1, 0 ]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!