Problem

Source:

Tags: number theory, Poland, TST, combinatorics



A prime $p>3$ is given. Let $K$ be the number of such permutations $(a_1, a_2, \ldots, a_p)$ of $\{ 1, 2, \ldots, p\}$ such that $$a_1a_2+a_2a_3+\ldots + a_{p-1}a_p+a_pa_1$$is divisible by $p$. Prove $K+p$ is divisible by $p^2$.