Question 127
Let $p$ be an odd prime. Determine the number of tuples $\left(a_{1}, a_{2}, \ldots, a_{p}\right)$ of natural numbers with the following properties:
1) $1 \leq a_{i} \leq p$ for all $i=1, \ldots, p$.
2) $a_{1}+a_{2}+\cdots+a_{p}$ is not divisible by $p$.
3) $a_{1} a_{2}+a_{2} a_{3}+\ldots +a_{p-1} a_{p}+a_{p} a_{1}$ is divisible by $p$.
1) $1 \leq a_{i} \leq p$ for all $i=1, \ldots, p$.
2) $a_{1}+a_{2}+\cdots+a_{p}$ is not divisible by $p$.
3) $a_{1} a_{2}+a_{2} a_{3}+\ldots +a_{p-1} a_{p}+a_{p} a_{1}$ is divisible by $p$.