[Math] Find the smallest positive integer for which x mod 3 = 2 and x mod 4 = 3

discrete mathematicsmodular arithmetic

I came across a question on a piece of homework and my solution yields no possible solutions.

Find the smallest positive integer for which
x mod 3=2 and x mod 4=3 (and then find the next one)

So I figure (by the Quotient-Remainder Theorem)

n mod 3 = 2 => n = 3q + 2

n mod 4 = 3 => n = 4q + 3

No problems thus far and everything works out fine logically so I set the equations equal to each other and find that q = -1.

Wait, it can't be negative. So I put it on a graph to check my comprehension and like I thought that is the only point at which they meet is outside my possible domain.

Could someone point out the error in my logic here? Or perhaps I've misinterpreted the question? Apologies if the answer is simple and I've missed it.

Best Answer

If $x\pmod4\equiv3$, then $x=4k+3$ for some integer $k$. Considering this equation modulo $3$, we get

$$x\equiv k\equiv2\pmod3$$

So for some integer $a,k=3a+2$. Combining these, we get

$$x=4k+3=4(3a+2)+3=12a+11$$

Related Question