Solving a system of linear congruences 
Find all positive integer solutions to \begin{align*}x &\equiv -1 \pmod{n} \\ x&\equiv 1 \pmod{n-1}. \end{align*}

I rewrote the system as $x = nk_1-1$ and $x = (n-1)k_2+1$. Thus, we have $nk_1-1 = (n-1)k_2+1$ and so $n(k_1-k_2) = 2-k_2 \implies n = \frac{2-k_2}{k_1-k_2}$. How do I solve it from here?
 A: As $n,n-1$ are relatively prime the Chinese Remainder Theorem guarantees a unique solution $\pmod {n(n-1)}$ .  Indeed we have, $$x\equiv 2n-1 \pmod {n(n-1)}$$
To see this, solve the first congruence to get $x=-1+mn$.  Substituting that into the second gives $$-1+mn\equiv 1 \pmod {n-1}\implies mn\equiv 2 \pmod {n-1}\implies m\equiv 2 \pmod {n-1}$$
And we are done.
A: First note that $x_0=2n-1$ is a solution. 
Now, if $x$ is a solution, then $x\equiv x_0\pmod n$ and $x\equiv x_0\pmod {n-1}$. Thus, $n|x-x_0$ and $(n-1)|x-x_0$. Also, since $\gcd(n,n-1)=1$, we have $n(n-1)|x-x_0$. 
Moreover, for all non-negative integer $k$, we can check that $x=2n-1+kn(n-1)$ is a solution. 
Thus, all solutions are $x=2n-1+kn(n-1)$, where $k\in \mathbb{Z}_{\geqslant 0}$.
A: The two congruences are equivalent to $$\begin{cases}x=nu-1\\x=(n-1)v+1\end{cases}$$
It follows the diophantine equation $$nu-(n-1)v=2$$ which admits the particular solution $(u,v)=(2,2)$ hence the general solution is  $$\begin{cases}u=(n-1)t+2\\v=nt+2\end{cases}$$ Finally one has
$$x=n((n-1)t+2)-1$$ where $t$ is an arbitrary integer.
(The first congruence is clearly verified; the second gives $x\equiv 2n-1\equiv 1\pmod{n-1}$ because of $2n-1=2(n-1)+1$)
