I have $6$ decision variables $(x_1, x_2, x_3, x_4, x_5, x_6)$ in my problem. All of them are integer and $\ge 0$ and they represent a sequnce. I want to put constraints on them that if a variable is populated then the next $2$ immediate variables should be populated with the same value too.
How could I define that constraints mathematically?
For example 0,1,1,1,0,0 is okay 1,0,1,0,1,0 is not okay 2,2,2,0,0,0 is okay 1,1,2,1,1,0 is okay because it is addition of 1,1,1,0,0,0 and 0,0,1,1,1,0 1,1,2,1,0,0 is not okay 0,0,0,1,1,1 is okay 1,1,1,1,1,0 is not okay
I realized that sum of my numbers has to be multiple of $3$.
I also thought about creating a new series where $y_1=x_1+x_2+x_3$, $y_2=x_2+x_3+x_4$ , $y_3=x_3+x_4+x_5$ , $y_4=x_4+x_5+x_6$ . But How could I use $\,y_1, y_2, y_3\,$ and $\,y_4$ .