Let k∈Z+ and set n=2k+1. Prove that n is a prime number if and only if the following holds: there is a permutation a1,…,an−1 of the numbers 1,2,…,n−1 and a sequence of integers g1,…,gn−1, such that n divides giai−ai+1 for every i∈{1,2,…,n−1}, where we set an=a1.Proposed by Vasily Astakhov, Russia functionnumber theoryIMO Shortlist