Modular arithmetic for arbitrary number

128 Views Asked by At

The problem describes as:

When the even integer $n$ is divided by $7$,the remainder is $3$. What's is The remainder when $n$ is divided by $14$.

My simple solution is:

$n=7x+3$ where $x$ is odd, so, we can define $x = 2m+1$, then $n = 7(2m+1) + 3 = 14m + 7 +3= 14m + 10$. So reminder is: $10$

As I am learning the mod system and was trying to solve this problem with modulo arithmetic. But got stuck with "how to think this prob in modulo system" ie. if $$n \equiv 3 \pmod{7} $$ then $$n \equiv \ ? \pmod {14} $$

Any help regarding solving steps and learning reference would be appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

As I said in the comments I think is fine the way you did it. I would suggest you to use "congruent to" instead of "equal to" as in my comment from the beginning, or add it at the end of the conversions you did as a last step.

Said that, maybe your question is more related with this point: how you could make a solution starting backwards? from $14m+r$.

Let us start with:

$$n=14m+r$$

Then, let us suppose three possibilities:

  1. $r \lt 7$

  2. $r = 7$

  3. $7 \lt r \lt 14$ so we can define $r=7+r'$, where $r' \lt 7$


  • For the first case:

$$n=14m+r \pmod{7} \equiv 2\cdot 7m\pmod{7} + r \pmod{7} \equiv 0+r \equiv 3$$

Thus:

$$r=3$$

But that is not possible because it means that $n = 14m + 3$, but $14m+3$ is not even, and we know that $n$ is even, so that solution is not possible.

  • For the second case:

$$n=14m+7 \pmod{7} \equiv 2\cdot 7\pmod{7} + 7 \pmod{7} \equiv 0 \equiv 3$$

So it is impossible for the residue to be $r=7$ because $14m+7 \not \equiv 3 \pmod {7}$, the residue does not comply the premise, being $\equiv {3} \pmod{7}$, it is indeed $\equiv {0} \pmod {7}$.

  • For the third case:

$$n=14m+r \pmod{7} \equiv 2\cdot 7\pmod{7} + 7 + r' \pmod{7} \equiv 0+0+r' \equiv 3$$

Thus finally the unique remaining valid option is $7 \lt r = 10 \lt 14$:

$$r'=3, r=7+r'=7+3=10$$