MathDB
Mathematicians mod n

Source: 2012 AIME I Problem 15

March 16, 2012
modular arithmeticpigeonhole principleAMCAIMEnumber theoryrelatively prime

Problem Statement

There are nn mathematicians seated around a circular table with nn seats numbered 1,2,3,,n1,2,3,\cdots,n in clockwise order. After a break they again sit around the table. The mathematicians note that there is a positive integer aa such that
(1) for each kk, the mathematician who was seated in seat kk before the break is seated in seat kaka after the break (where seat i+ni+n is seat ii); (2) for every pair of mathematicians, the number of mathematicians sitting between them after the break, counting in both the clockwise and the counterclockwise directions, is different from either of the number of mathematicians sitting between them before the break.
Find the number of possible values of nn with 1<n<10001<n<1000.