How to find $n$ in this equation? (involving modulus)

51 Views Asked by At

How to find $n$ in this equation?

$10 \le (7n) \mod 24 \le 13$

Can I use program to solve this kind of equation?

1

There are 1 best solutions below

0
On BEST ANSWER

You are looking to solve $7n\equiv k \pmod {24}$ for $k=10,11,12,13$. Just like in the reals you would like to multiply by the inverse of $7$. As $7$ is coprime to $24$ you can find it. You can generally use the Euclidean algorithm, but here we can do it by inspection. We note that $7\cdot 3 \equiv -3 \pmod {24}$, so $1=7-2\cdot 3$ gives $7\cdot (1+2\cdot 3)=7\cdot 7 = 49 \equiv 1 \pmod {24}$ and $7$ is its own inverse. Then $$7n \equiv 10 \pmod {24}\\n\equiv 7\cdot {10} \pmod {24}\\22 \equiv n \pmod {24}$$ and the others are similar.