Solve equation with Euclidean Division

59 Views Asked by At

I can't solve the following problem:

Find $n$, $d$ and $q$ that satisfies that:

  • The division of $n+5$ and $d$ (I mean $(n+5)/d$) produces a quotient of $q$ and a remainder of $2$.

  • The division of $4n-4$ and $d+1$ produces a quotient of $2q+2$ and a remainder of $2d-6$.

2

There are 2 best solutions below

4
On BEST ANSWER

$n + 5 = dq + 2$

$4n-4 = (d+1)(2q+2) + 2d - 6$

Can you solve those? 2 equations three unknowns?

$n = dq - 3$

$4dq - 12 - 4 = 2dq + 2q + 2d + 2 + 2d - 6$

$4dq - 16 = 2dq + 2q + 4d -4$

$2dq = 2q+ 4d +12$

$dq = q + 2d + 6$

$(d-1)q =2d + 6$

$q = (2d + 6)/(d-1) = (2d -2)/(d-1) + 8/(d-1) = 2 + \frac 8{d-1}$

Note all are positive integers and the remainders is less than the divisor and more than $0$.

So $2<d$ and $2d-6 < d$ so $d < 6$. So $d-1|8$ so the only options are $d =3$ or $d = 5$. But if $d=3$ then $2d - 6 = 0$. So $d =5$

So $q = 4$ and $n= 17$

And check: $\frac {17+5}5 = 4 R 2$ check

and $\frac {4*17 - 4}{6} = \frac {64}6 = 10 R 4 = (2*4 + 2) R (2*5 - 6)$

0
On

$\dfrac{n+5}{d} = q + \dfrac{2}{d} \tag 1$

$\dfrac{4n-4}{d+1} = 2q+2 + \dfrac{2d-6}{d+1} \tag 2$

If we require that $0 \le 2d-6 < d+1$, then we must have $3 \le d \le 6$

Solving $(2)$ for $2n$, we get \begin{align} (4n-4)=(d+1)(2q+2)+(2d-6) &\implies (2n-2)=(d+1)(q+1)+(d-3) \\ &\implies 2n-2 = 2d+q+dq-2 \\ &\implies 2n = 2d+q+dq \\ \end{align}

Solving $(1)$ for $n$, we get $n+5 = dq+2 \quad \implies \quad n = dq-3$

Eliminating $n$, \begin{align} 2(dq-3) &= 2d+q+dq \\ 2dq-6 &= 2d+q+dq \\ dq &= 2d+q+6 \\ 2d-dq+q &= -6 \\ d(2-q)-(2-q) &= -8 \\ (d-1)(q-2) &= 8 \end{align}

Remembering that $3 \le d \le 6$, there is only one all-integer solution to $(d-1)(q-2) = 8$, and it gives us $n=15, d=3,$ and $q=6$.