1

I just have a question that is it: I want to know the equation that finds an unknown number which is a number that when we will mod it with 17 it is equal to 3 and when we mod it with 16 it is equal to 10 and when we will mod it with 15 it will equal to 0.

in other words, I am a programmer and I want to know what is the equation in mathematics that will find the unknown number.

I know the unknown number is 3930, but I don't know what is the equation that will find the number. thanks to all of you.

J. W. Tanner
  • 60,406

2 Answers2

1

There is a formula if the moduli $m_1,m_2,m_3$ are pairwise coprime, which is the case here. Then you know there is a Bézout's relation between $m_1m_2, m_2m_3$ and $m_3m_1$: $$um_1m_2+v m_2m_3+wm_3m_1=1,\quad (u,v,w\in\mathbf R)$$ Then the solutions of the system of congruences \begin{cases} x\equiv \alpha_1\mod m_1, \\ x\equiv \alpha_2\mod m_2, \\x\equiv \alpha_3\mod m_3, \end{cases} are given by the following formula, similar to Lagrange's interpolation formula: $$x\equiv um_1m_2\alpha_3+v m_2m_3\alpha_1+wm_3m_1\alpha_2\mod m_1m_2m_3.$$

Bernard
  • 175,478
0

We can use CRT, which guarantees that a solution exists, or by direct calculation

  • $x\equiv 3 \mod 17 \implies x=17k+3$
  • $x\equiv 10 \mod 16 \implies 17k+3\equiv10 \implies k\equiv 7 \mod 16 \implies k=16h+7 \\\implies x=16\cdot 17h+122$
  • $x\equiv 0 \mod 15 \implies 16\cdot 17h+122\equiv 0\implies 2h\equiv-2\implies h\equiv 14 \mod 15 \\\implies h=15j+14$

then all solutions are in the form

$$x=15\cdot 16\cdot 17 j+3930$$

user
  • 154,566