Given n mod 2 = 1 and n mod 3 =1. Find n mod 5. How to solve algebraically knowing n = 7

modular arithmetic

I know that n = 7, so I should expect a remainder of 2 when divided by 5. However, finding the solution algebraically gives me a wrong remainder of 6. Please help me find my errors, or even find a better way to approach this problem. My work is shown below. $$$$
I know that a general solution involves finding n in terms of the equations:
$$ n = 2k + 1$$
$$n = 3m +1$$
I try to make both equations have a divisor of 5 like this:
$$\frac{5}{2}n = 5k + \frac{5}{2}$$ and
$$\frac{5}{3}n = 5m + \frac{5}{3}$$
I try to find the value of n by noticing $n = \frac{5}{2}n -\frac{9}{10} \cdot(\frac{5}{3}n)$.
$$n = (5k + \frac{5}{2}) – \frac{9}{10}\cdot(5m + \frac{5}{3})$$
This becomes $$n = (5k – 5m\cdot \frac{9}{10})+ (\frac{5}{2} -\frac{5}{3}\cdot\frac{9}
{10})$$

When I simplify this I get $$n = 5(k-\frac{9m}{10})+1$$
I note that $1 = -5 + 6$, therefore
$$n = 5(k-\frac{9m}{10}) -5 +6$$
So in the end $$n = 5(k-\frac{9m}{10} -1) +6$$
I get a remainder of 6 but I was expecting a remainder of 2. Thank you for your time.

Best Answer

$n$ could be $1,7,13,19$ or $25$, so $n\pmod5$ could be $1,2,3,4$ or $0$.

Related Question