Easy inverse CRT: moduli $m',m$ satisfy $m'\equiv \pm1\pmod{\!m}$

209 Views Asked by At

I had the following exercise: \begin{equation} \begin{cases} n \equiv 1023 \bmod 2015\\ n \equiv 1302 \bmod 2016 \end{cases} \end{equation}

Since $2015$ and $2016$ are coprime, we could use the Chinese Remainder theorem to compute $n$ and then add or substract multiples of $2015 \cdot 2016$ in order to find $n$. However, this seemed a quite large computation to me, so I computed that $\text{gcd}(2015, 1023) = 31$ and $\text{gcd}(2016, 1302) = 42$. Since $2015$ divides $1023 - n$, we must have that $31$ divides $1023 - n$, which would result in $n \equiv 1023 \equiv 0 \bmod 31$, since $31$ divides $1023$. In the same way, I would get that $n \equiv 0 \bmod 42$. But this would give as a solution that $n = 0$ (or $31 \cdot 42$ depending on whether we treat $0$ as a natural number), but this is clearly not correct...

I have no idea where I made an error, so my questions are:

[1] Where did I make a mistake

[2] This method I used is clearly not right, so how could I simplify the given system of congruences to something which is easier to compute?

Thank you in advance

2

There are 2 best solutions below

2
On BEST ANSWER

We search numbers $s,t$ with $$n=2015s+1023=2016t+1302$$

Taking this modulo $2015$ gives

$$1023=t+1302$$ immediately giving $t=-279\equiv 1736\mod 2015$

Hence, we have $n=2016\cdot 1736+1302=3501078$

0
On

It's an easy inverse case of CRT, i.e. one modulus is $\equiv 1\,$ mod the other, so the $\rm\color{#c00}{inverse}$ in the CRT formula is trivial to compute, e.g. specializing $ $ Easy CRT $ $ with $\rm\,\color{#c00}m\equiv \pm1\pmod{\! n}\,$ yields

Theorem $\ $(Easy CRT) $\rm\,\ $ If $\rm\ m,\,n\:$ are coprime integers then

$\ \ \ \qquad\qquad\qquad\quad\qquad\qquad\displaystyle\begin{align}&\rm x\equiv a\!\!\pmod{\!m}\\ &\rm x\equiv b\!\!\pmod{\! n}\end{align}$ $\displaystyle\! \iff\rm x \equiv a + m \bigg[\frac{\color{#0a0}{b-a}}{\color{#c00}m}\ mod\ n\bigg]\!\!\!\pmod{\!mn}$


$\rm {\rm if}\ \ m\equiv \pm1\pmod{\!n}\,\ \ {\rm then}\ \ \begin{align}&\rm x\equiv a\!\!\pmod{\!m}\\ &\rm x\equiv b\!\!\pmod{\! n}\end{align}$ $\!\iff \rm x^{\phantom{|^{|}}}\!\!\! \equiv a \pm m\,(\color{#0a0}{b-a})\,\ \pmod{\!mn}$


Hence we conclude that: $\ \begin{align}&\rm x\equiv a\!\!\pmod{\!2016}\\ &\rm x\equiv b\!\!\pmod{\! 2015}\end{align}\!\iff \rm x \equiv a + 2016\,(b\!-\!a)\,\ \pmod{\!2016\cdot 2015}$

OP is the special case $\rm\,a = 1023,\ b = 1302.\,$