How many solutions to this system of linear equations in $\mathbb{Z}_N$? Given distinct non-negative integers $i$ and $j$, and given $a,b\in\mathbb{Z}_N$, is it true that there is at most one $(x,y)\in \mathbb{Z}_N^2$ so that
$$x+iy\equiv a \mod N,$$
$$x+jy\equiv b \mod N?$$
When it is in $\mathbb{Z}\subseteq\mathbb{Q}$, as the determinant of coefficient matrix is $j-i\neq 0$, there is at most 1 solution. But what about $\mathbb{Z}_N$?
**Revision: **to avoid some trivial cases, we can assume $i,j$ are distinct integers between $1$ and $N$.
**Further Revision: **if there are more than 1 solution, can you give some reasonable upper bound for the number of solutions?

If $j \equiv i$ mod $N$ there may be zero or infinitely many solutions, depending on $a,b.$ But if not we can subtract the two equations and get $(j-i)y \equiv b-a$ mod $N.$ Then provided $j-i$ is invertible mod $N$ we might have a unique solution (again depending on $a,b$ mod $N.$)
Edit: When $j-i$ is invertible we can get $y=(j-i)^{-1}(b-a)$ uniquely. And with this $y$ value, either equation solved for $x$ gives the same value, so uniqueness works in this case.
User Connor asks what if $j-i$ not invertible; I don't know what happens in general in that case, it may be involved.
So I think the unique solution question is a bit involved in general.
Added: OP Connor has asked about the number of solutions. Let $d=\gcd(j-i,N).$ Then a necessary condition for solutions to exist is that $d$ divide $b-a.$ When it does there are exactly $d$ solutions mod $N$; get any one of the $y$ by using $(j-i)y \equiv b-a$ mod $N,$ then either equation determines $x$ mod $N$ (both give the same thing).
