2014 Canadian MO Problems/Problem 3

Problem

Let $p$ be a fixed odd prime. A $p$-tuple $(a_1,a_2,a_3,\ldots,a_p)$ of integers is said to be good if

(i) $0\le a_i\le p-1$ for all $I$, and (ii) $a_1+a_2+a_3+\cdots+a_p$ is not divisible by $p$, and (iii) $a_1a_2+a_2a_3+a_3a_4+\cdots+a_pa_1$ is divisible by $p$.

Determine the number of good $p$-tuples.

Solution

This problem needs a solution. If you have a solution for it, please help us out by adding it.