# Solving $N\equiv1\pmod2,N\equiv2\pmod3,\dots,N\equiv n-1\pmod n$

If I have:
\begin{align*} N &\equiv 1 &\pmod{2}\\ N &\equiv 2 &\pmod{3}\\ N &\equiv 3 &\pmod{4}\\ &\vdots\\ N &\equiv n - 1 &\pmod{n} \end{align*} How could I solve for $N$? Is there any property relates to this problem?

Update
Base on Moron hint, we have:
\begin{align*} N + 1 &\equiv 0 &\pmod{2}\\ N + 1 &\equiv 0 &\pmod{3}\\ N + 1 &\equiv 0 &\pmod{4}\\ \vdots\\ N + 1 &\equiv 0 &\pmod{n} \end{align*} Hence, $$N + 1 \equiv 0 \pmod{\mathrm{lcm}(2\cdot 3\cdots n}$$

$$\therefore N + 1 = lcm(2.3.4...n) * k \text{ for some integers k }$$ $$\implies N = lcm(2.3.4...n) * k - 1$$

Does it look right?

Thanks,
Chan

-
$N = k \times \text{lcm}(1,2,\ldots,n)-1$ where $k \in \mathbb{Z}$ – user17762 Feb 28 '11 at 0:04
@Sivaram Ambikasaran: Thanks, but could you explain how it works? I know there is a property for $\pmod{lcm}$, but in this case the right hand side parts are different. It goes from 1 -> n - 1. – Chan Feb 28 '11 at 0:08
@Qiaochu Yuan: Thanks for the link – Chan Feb 28 '11 at 0:10
@Chan: As Qiaochu points out this is nothing but a special case of Chinese Remainder Theorem. your $N \equiv -1 \bmod m$, $\forall m \in \{1,2,\ldots,n\}$ – user17762 Feb 28 '11 at 0:11

Hint: Consider the possible values for $N+1$.