# Modular arithmetic for arbitrary number

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.

• "how to think this prob in modulo system" well it depends of the meaning of those words, but IMHO I think you did it nicely that way indeed. You converted a problem in $\pmod{7}$ to a problem in $\pmod{14}$. Maybe is just a question of formatting your answer as a "modulo system problem": $x = 2m+1$, then $n = 7(2m+1) + 3 \pmod{14} \equiv 14m + 7 +3 \pmod{14} \equiv 14m + 10 \pmod {14} \equiv 14m \pmod{14} + 10 \pmod {14} \equiv 10 \pmod{14}$. – iadvd Apr 26 '17 at 5:22
• Edited the question a bit for better understandability of my points that is, I was thinking the format: if n mod 7 = 3 then n mod 14 = ?. That's how I was thinking. Thanks for replying! – neo-nant Apr 26 '17 at 5:46
• ok I have added a solution going backwards... I think that you meant that possibility. But the way you did it is easier and indeed my solution is based on your substitutions (but backwards, it is kind of tricky). – iadvd Apr 26 '17 at 7:03

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$.

$$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$$