If $abc\equiv x\pmod{p}$ and $x\not\equiv 0\pmod{p}$ what are the number of solutions for given $x$ and $p$ 
Possible Duplicate:
Solutions of $\prod_{i=1}^n x_i = c$ mod p 

I guess it should be $3(p-2)+1$ modulo $n$ as there are $3$ possibilities for abc to be congruent to $2,\cdots ,p-1$ each and one solution for abc to be congruent to $1$. 
 A: There are $p-1$ choices for $a$ and $p-1$ choices for $b$ since $a,b$ can be congruent to any nonzero numbers mod $p$. Once $a,b$ are chosen, we must have $c = x(ab)^{-1}$ mod $p$, so there is only one choice for $c$. Overall, there are $(p-1)(p-1)\cdot1 = (p-1)^2$ triples $(a,b,c)$ satisfying the given equation.
Your reasoning in your answer to https://math.stackexchange.com/questions/52036/re-can-you-give-me-a-complete-answer-not-just-hint is not correct. For example, you claim that if $\prod x_i = 1$ mod $p$, then each $x_i$ must be congruent to $1$ mod $p$. But this is not true, e.g. $x_1x_2 = 1$ mod $3$ has two solutions, namely $(1,1)$ and $(2,2)$. So we could have that neither $x_1$ nor $x_2$ is $1$ mod $3$, yet their product is $1$ mod $3$. The other claims that $\prod x_i = 2$ implies that one of the $x$'s is congruent to $2$ mod $p$ and all others are congruent to $1$ mod $p$, and that $\prod x_i = p-1$ implies that one of the $x$'s is congruent to $p-1$ mod $p$ and all others are congruent to $1$ mod $p$ are also wrong. It looks like you treat $x_1,x_2,..,x_n$ as if they were positive integers, but they are not.
Anyway, as many people pointed out, the correct answer to your question is $(p-1)^2$ (unless you meant to ask something different).
