i was doing an exercise, where I ended up with this equation:
$p = 1 mod (5)$
$p = 1 mod (2)$
I was trying to use Chinese theorem to see what number p takes form, but it is giving a wrong answer: $p = \sum a^{i}x^{i}M^{i}$
$a^{i} = x^{i} = 1$
$p = \sum M^{i}$
$ p = 5 + 2 = 7$ :q
Recall the procedure of CRT:
In your case, it seems that you have the wrong $x^i$.
What we are to solve is $$\begin{cases} 2M_1+5m_1=1 \\ 5M_2+2m_2=1\end{cases} $$ Apply Extended Euclidean algorithm, we have $$ \begin{cases} M_1=3,m_1=-1\\ M_2=-1,m_2=3 \end{cases} $$ Thus a special solution can be calculated: $$ x_0=\sum a_iM_iN_i=1\times 3\times 2+1\times (-1)\times 5=1 $$ And all solutions are of the form $$ x = Nq+x_0,q\in\mathbb Z $$