# Under what conditions can we obtain $a \equiv 1 \pmod{mn}$ from $a \equiv b \pmod{m}$ and $b \equiv 1 \pmod{mn}$?

If $a \equiv b \pmod{m}$ and $b \equiv 1 \pmod{mn}$, are there any conditions under which we can conclude that $a \equiv 1 \pmod{mn}$?

Here $m$ and $n$ are any integers; $a$ and $b$ are both coprime to $mn$.

• It is sufficient for $n=1$, of course, and not necessarily true in any greater generality. – hardmath Aug 17 '14 at 1:00
• Are $m$ and $n$ any integers? Prime? Coprime? – Mike Aug 17 '14 at 1:01
• m and n are any integers. a and b are both coprime to mn. – Mike Aug 17 '14 at 1:11
• Important information (such as your comment about $a$ being coprime to $mn$, which did not follow from the question) should be edited into the question, not left in a comment. – user147263 Aug 17 '14 at 4:14
• This question is missing key information: (1) what is the context or background where you came upon the question; (2) what have you tried, or why do the solution methods you know not work? This information helps others write answers that are more useful to you. Questions without this info are likely to be put "on hold". – Carl Mummert Aug 17 '14 at 4:22

We know that we can find integers $k,\ell$ such that

$$a = b + km$$ $$b = 1+ \ell mn$$

Hence,

$$a = 1+\ell mn+km = 1 + (\ell n+k)m$$

So if we want $a \equiv 1 \pmod{mn}$ then we need $\ell n+k \equiv k \equiv 0 \pmod{n}$. Hence

$$a \equiv b \pmod{mn}$$

• Given that $b \equiv 1 \pmod{mn}$, it's immediate that $a \equiv 1 \pmod{mn}$ if and only if $a \equiv b \pmod{mn}$. While this certainly gives conditions for the statement to hold, it seems like the OP is probably seeking something less tautological. – vociferous_rutabaga Aug 17 '14 at 1:21
• To conclude $\ell n + k \equiv k \equiv 0 (\mod n)$ don't you need to assume $m$ and $n$ are coprime? – NovaDenizen Aug 17 '14 at 5:54