Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

if I were asked to find all integers between 1 and 100 that leave remainder 3 on division by 5 and leave remainder 4 on division by 7, how would I go about this? It seems like such a simple question yet I am not sure if there is a simple algorithm that I can use? It should jump out at me but it doesn't seem to.

share|cite|improve this question
Do you know how to do it if you have only one constraint, leaving a remainder of $r$ on division by $d$? – Daniel Fischer Aug 10 '14 at 11:19
CRT: Chinese Remainder Theorem. To find one of solutions ($18$), then $\pm 35, \pm 70, \pm 105, ...$, while they were in $[1,100]$. – Oleg567 Aug 10 '14 at 11:27
up vote 6 down vote accepted

As suggested by oleg567 you have to solve the following

$\begin{cases} x \equiv 3 \pmod{5}\\ x \equiv 4 \pmod{7}\\ \end{cases}$

or you can write

$\begin{cases} x=3+5t\\ x=4+7s \end{cases}$

Now after subtituting the value of $x$ from first equation into the second equation you will have


or you can write

$3+5t=4 \pmod{7}$ $\hspace{0.3cm}$$\implies$$\hspace{0.3cm}$$5t=1 \pmod{7}$


$t=5^{-1} \pmod{7}=3 \pmod{7}$





Hence the all integers between$\hspace{0.1cm}$$1$ and $100$ that leave remainder $3$ on division by $5$ and leave remainder $4$ on division by $7$ are


share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.