MathDB
a_1a_2 + a_2a_3 + . . . +a_{p-1}a_p + a_pa_1 is divisible by p

Source: Switzerland - 2015 Swiss MO Final Round p9

January 14, 2023
number theorydividesdivisible

Problem Statement

Letp p be an odd prime number. Determine the number of tuples (a1,a2,...,ap)(a_1, a_2, . . . , a_p) of natural numbers with the following properties: 1) 1aip1 \le ai \le p for all i=1,...,pi = 1, . . . , p. 2) a1+a2++apa_1 + a_2 + · · · + a_p is not divisible by pp. 3) a1a2+a2a3+...+ap1ap+apa1a_1a_2 + a_2a_3 + . . . +a_{p-1}a_p + a_pa_1 is divisible by pp.