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$ .
It seems that you want linear combinations of the following vectors:
$v_1=(1,1,1,0,0,0), v_2=(0,1,1,1,0,0), v_3=(0,0,1,1,1,0), v_4=(0,0,0,1,1,1)$
A linear combination will take the form $a_1 v_1 + a_2 v_2 + a_3 v_3 +a_4 v_4$.
From your response to https://math.stackexchange.com/users/6460/henry's comment it appears that $a_1 \ge 0, a_2 \ge 0,a_3 \ge 0,a_4 \ge 0$.
Translating this back to your original variables gives these:
$x_1=a_1$
$x_2=a_1+a_2$
$x_3=a_1+a_2+a_3$
$x_4=a_2+a_3+a_4$
$x_5=a_3+a_4$
$x_6=a_4$
These equations come from setting $(x_1,x_2,x_3,x_4,x_5,x_6)=a_1(1,1,1,0,0,0)+ a_2(0,1,1,1,0,0)+a_3(0,0,1,1,1,0)+a_4(0,0,0,1,1,1)$
$(x_1,x_2,x_3,x_4,x_5,x_6)=(a_1,a_1,a_1,0,0,0)+ (0,a_2,a_2,a_2,0,0)+(0,0,a_3,a_3,a_3,0)+(0,0,0,a_4,a_4,a_4)$
$(x_1,x_2,x_3,x_4,x_5,x_6)=(a_1,a_1+a_2,a_1+a_2+a3,a_2+a_3+a_4,a_3+a_4,a_4)$
More generally, if there are $n$ decision variables then:
$x_1=a_1$
$x_2=a_1+a_2$
$x_3=a_1+a_2+a_3$
$x_4=a_2+a_3+a_4$
.
.
.
$x_i=a_{i-2}+a_{i-1}+a_i$
.
.
.
$x_{n-2}=a_{n-4}+a_{n-3}+a_{n-2}$
$x_{n-1}=a_{n-3}+a_{n-2}$
$x_n=a_{n-2}$