# Modular arithmetic with the mod > number

I have the problem $6 \mod 18$. I read the equation $n=qm+r$ online, where $n$ is your number to be converted, $m$ is your mod, and $r$ is your remainder. I read that for negative numbers, $qm<n$ and otherwise $q$ is the greatest number that goes into $n$ without going over $n$, i.e., what you'd get if you divided normally. So I plugged it in: $6=18q+r$, and I thought that $q$ would be $\frac{1}{3}$ and $r=0$, and so $0$ is the solution. The answer is $6$, and I don't know what I did wrong. Could I have some guidance?

• In your division rule, $q,r\in \mathbb Z$. In this case, $q=0,r=6$. – lulu Oct 4 '16 at 22:28
• $q,r$ must be both integers, with the remainder $0 \le r \lt m$. In your case $6 = 0 \cdot 18 + 6$. – dxiv Oct 4 '16 at 22:28

No, $q$ and $r$ must be integers, so the solution is $(0, 6)$.