How to solve system of modular equivalence with parameter Given system of modular equivalences. Find the smallest natural parameter $a$ that system has solutions
$$\begin{cases}
x \equiv a \mod 140\\
x \equiv 3 \mod 91\\
x \equiv 2a \mod 39
\end{cases}$$
Of course, solution will be appreciated but if you don't want to solve this then please give me some hint, I don't even know how to approach this problem
 A: No prime factorization of moduli is needed - only quick gcds. By the CRT solvability criterion, a system is solvable iff it is pairwise solveble iff each pair is consistent mod their moduli gcd. Let's check all pair consistencies. For the first pair $\,1,2\,$ the moduli gcd is $\,(140,91) = 7\,$ so
$\qquad\qquad\begin{align} x&\equiv a\!\!\!\pmod{\!140}\\ x&\equiv 3\!\!\!\pmod{\!91}\end{align}\,$ $\Rightarrow\, \begin{align} x&\equiv a\!\!\!\pmod{\!7}\\ x&\equiv 3\!\!\!\pmod{\!7}\end{align}\,$ $\Rightarrow\, \color{#c00}{a\equiv 3}\pmod{\!\color{#c00}{7}}$
For pair $\,1,3\,$ the moduli gcd $= (140,39)\!=\!1\,$ so it is always solvable. For pair $\,2,3,\,$ exactly as above we get $\bmod \color{#0a0}{13}\!=\!(91,39)\!:\,\ 2a\equiv 3\!\!\underset{\times 7\!\!}\iff \color{#0a0}a\equiv 21\equiv \color{#0a0}8.\,$ Thus the system is solvable iff
$$\begin{align} \color{#c00}{a\equiv 3}&\!\!\pmod{\!\color{#c00}7}\\ \color{#0a0}{a\equiv 8}&\!\!\pmod{\color{#0a0}{\!13}}\end{align}\qquad\qquad$$
By Easy CRT the solution is $\ a\equiv \color{#0a0}8+13\underbrace{\left[\dfrac{\color{#c00}3-\color{#0a0}8}{13}\bmod 7\right]}_{\!\!\!\large \color{#90f}{-5/(-1)}\ \bmod 7}\equiv 8+13[\color{#90f}5]\equiv 73\pmod{\!7\cdot 13}$
Remark $ $ Because this method uses only gcds (vs. prime factorizations) it can be done efficiently (by machine or hand) for huge moduli - which would not be possible using prime factorizations, since currently their is no known efficient algorithm to compute prime factorizations, but there is one for gcds - the Euclidean algorithm.
A: Take a look at the Chinese Remainder Theorem
For your case, x = 3 mod 91 = 3 so you can see:
3 = a mod 140
3 = 2a mod 39

From where you get:
a = 3 + 140 * k1
a = (3 + 39 * k2 ) / 2

Now the problem looks simpler, since you just need to find the smaller pair (k1, k2) for which:
3 + 140 * k1 = (3 + 39 * k2 ) / 2

By solving you can get:
k1 = 33
k2 = 237
a = 4623

PD: sorry for the formatting, still learning how my way
A: $$x\equiv a\pmod{4,7,5}$$
$$x\equiv3\pmod{7,13}$$
$$x\equiv2a\pmod{3,13}$$
So, $a\equiv3\pmod7\  \ (1)$
$$2a\equiv3\pmod{13}\equiv13+3$$
$\iff a\equiv8\pmod{13} \ \ (2)$
Apply Chinese remainder theorem on $(1),(2)$
A: If the system is consistent then it has solutions.
Since $140=4\cdot 5\cdot 7$ then the first system is equivalent to $$x \equiv a \pmod {4, 5, 7}$$
and similarly for the other congruences we have $x \equiv 3 \pmod{7, 13}$ and $x\equiv 2a \pmod{3,13}$.
From the first we have $x\equiv a \pmod{7}$ and from the second $x\equiv 3 \pmod{7}$. So for the system to be consistent we must have $a\equiv 3 \pmod{7}$.
Similarly from the second and third congruences we see that $a$ must also satisfy $2a\equiv 3\pmod {13}.$ Then since $2^{-1} \equiv 7 \pmod{7}$, we multiply the congruence by $7$ and obtain that $$14a\equiv a \equiv21\equiv8 \pmod{13}$$
Thus for the system to be consistent it has to satisfy $$a\equiv 3 \pmod{7}\space(1)$$ $$a \equiv8 \pmod{13}\space(2)$$
Since $7$ and $13$ are co-prime, there exists solutions modulo $7\times13=91$ by the CRT.
From $(2)$ we know that $a=8+13k_1$ for $k_1\in\mathbb Z$ and substituting into the first gives $$8+13k_1\equiv 3 \pmod{7}$$
$$13k_1\equiv 2 \pmod{7}$$
So $$13\times 6 k_1\equiv k_1\equiv 12\equiv 5 \pmod{7}$$
Thus $k_1=5+7k_2$ for $k_2\in\mathbb Z$ and hence we have $a=8+13k_1=8+13(5+7k_2)=73+91k_{2}.$
Hence $a\equiv 73 \pmod {91}$ and the smallest natural parameter of $a$ is $73$.
