# Remainder problem when dividing numbers

The number x is a positive integer < 100. When x is divided by 7, the remainder is 2, and when x is divided by 10 the remainder is 8. What is the value of x?

Is there a formula to solve this type of problem? I could guess numbers but that would take time. If there isn't a formula, could you show me the fast way to guess numbers for this problem

Less a formula than a strategy.

Since the number has a remainder of 8 when divided by 10, it ends with an 8. When the number is divided by 7, is has a remainder of 2; so there is a multiple of 7 which, when we add 2 to it, it gives a number that ends in 8. What multiple of 7 < 100 ends in 6? 56; so our number is 58.

• are your calculations correct? can you explain what you mean by a multiple of 7?
– user159778
Sep 19, 2014 at 23:10
• If $x$ has a remainder of 2 when divided by 7, then for some $m$, $x = 7m + 2$, and $7m$ is a multiple of 7. Sep 19, 2014 at 23:16

$$x<100$$

$$x \equiv 2 \pmod 7 \Rightarrow x=2+7k, k \in \mathbb{Z} (*)$$

$$x \equiv 8 \pmod {10} \overset{(*)}{\Rightarrow} 2+7k \equiv 8 \pmod {10}\\ \Rightarrow 7k \equiv 6 \pmod {10}$$

We check which of the numbers $1, \dots, 9$ satisfies the above relation.

For $k=1$, the relation is not satisied.

For $k=2$, the relation is not satisied.

For $k=3$, the relation is not satisied.

For $k=4$, the relation is not satisied.

For $k=5$, the relation is not satisied.

For $k=6$, the relation is not satisied.

For $k=7$, the relation is not satisied.

For $k=8$, the relation is satisfied $\checkmark$

For $k=9$,the relation is not satisfied.

So, we have $k=8$.

Therefore, $x=2+7 \cdot 8=58<100$.

• I can't remember the format of the equation "x=2+7k". Can you explain this equation so that I can remember it better?
– user159778
Sep 19, 2014 at 23:30
• @Ben It is known that if $x \equiv b \mod m$, then $m \mid x-b$ , that implies that $\exists k \in \mathbb{Z}$ such that $x-b=km \Rightarrow x=b+km$. Sep 19, 2014 at 23:46

The usual way to deal with this is the Chinese Remainder Theorem. But this is what I did.

The second piece of information tells us that $x$ ends with an $8$. Subtracting $2$, what is a multiple of $7$ that ends in $6$? Well $56$ works. So $x = 58$ is one solution.

• Why do you subtract 2?
– user159778
Sep 19, 2014 at 23:16
• $x$ has a remainder of $2$ when divided by $7$. So $x - 2$ would be evenly divisible by $7$. Sep 20, 2014 at 18:27

This is one fairly quick way to solve this problem.

 When x is divided by 7, the remainder is 2


$$x \equiv 2 \pmod 7$$
$$x = 2 + 7t$$ for some $$t.$$

 when x is divided by 10 the remainder is 8


$$x \equiv 8 \pmod{10}$$
$$2 + 7t \equiv 8 \pmod{10}$$
$$7t \equiv 6 \pmod{10}$$ (Note $$3 \cdot 7 = 21 = 1 \mod {10}$$)
$$21t \equiv 18 \pmod{10}$$
$$t \equiv 8 \pmod{10}$$ $$t = 8 + 10u$$

$$x = 2+7t = 2+7(8+10u) = 58+70u.$$

$$x \equiv 58 \pmod{70}$$