-1

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

Bill Dubuque
  • 272,048
  • When p has same remainder when divided by a and b, it means it has same remainder when divided by ab. So the number you are trying to find can have form $p=10 m +1$ – sirous Dec 23 '20 at 06:54

1 Answers1

0

Recall the procedure of CRT:

Given positive integers $n_1, \dots, n_k>1$ which are coprime to each other,define $N=\prod_{i=1}^k n_i$ and $N_i=\frac{N}{n_i}$. Given integers $a_1, \dots, a_k$, then the following system of coresidual equations $$ x\equiv a_1 \pmod{n_1}\\ x\equiv a_2 \pmod{n_2}\\ \vdots\\ x\equiv a_k\pmod{n_k} $$ have one unique solution when $0\le x < N$. Since $\gcd(n_i, N_i)=1\quad \forall i\in\{1, 2, \dots, k\}$, from Bézout's identity, we have for each $i\in\{1, \dots, k\}$, there exists integer $M_i, m_i$ s.t. $$ M_iN_i+m_in_i=1 $$ solve the equations above for $M_1, \dots, M_k$, then one special solution of this system of coresidual equation can be represented as: $$ x_0=\sum_{i=1}^k a_i M_iN_i $$ And general solutions are $$ x=Nq+x_0,q\in\mathbb Z $$

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 $$

FFjet
  • 5,041