Congruences- find the number of solutions 
*

*Find the number of solutions of $ a_1x_1+ ... +a_nx_n =$ b (mod m).


I was thinking of denoting $ d = (a_1,a_2,...,a_n,m)$.
Then the congruence has no solutions if $d$ doesn't divide $b$. And it has solutions when $d$ divides $b$.
I was thinking of using induction, but I didn't have a clear idea.(I think it may have $dm^{n-1}$ solutions ??)
Could someone please help me show the solutions of these questions more concretely?
1. Find the number of solutions to the congruence $ x^3-2x^2-x+2 = 0$ (mod 143) without finding the actual solutions.

For 1
(I guess the first problem is 0),
$x^3-2x^2-x+2 
=(x-2)(x^2-1)
=(x-2)(x-1)(x+1)
$
and
143 = 11*13.
Consider the possible values of $x$
that make
one or two terms in the product
divisible by 11 and 13.
