Maths Olympiad Prep

Library / /504 of 520

Number theory Difficulty 4.6 AIME Find the answer

There are nn mathematicians seated around a circular table with nn seats numbered 1,1, 2,2, 3,3, ...,..., nn in clockwise order. After a break they again sit around the table. The mathematicians note that there is a positive integer aa such that

(11) for each k,k, 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);

(22) 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<1000.1 < n < 1000.

A number or a short expression. Fractions can be typed as 3/2, and spacing doesn't matter.

Solution

It is a well-known fact that the set 0,a,2a,...(n1)a0, a, 2a, ... (n-1)a forms a complete set of residues if and only if aa is relatively prime to nn.
Thus, we have aa is relatively prime to nn. In addition, for any seats pp and qq, we must have apaqap - aq not be equivalent to either pqp - q or qpq - p modulo nn to satisfy our conditions. These simplify to (a1)p≢(a1)q(a-1)p \not\equiv (a-1)q and (a+1)p≢(a+1)q(a+1)p \not\equiv (a+1)q modulo nn, so multiplication by both a1a-1 and a+1a+1 must form a complete set of residues mod nn as well.
Thus, we have a1a-1, aa, and a+1a+1 are relatively prime to nn. We must find all nn for which such an aa exists. nn obviously cannot be a multiple of 22 or 33, but for any other nn, we can set a=n2a = n-2, and then a1=n3a-1 = n-3 and a+1=n1a+1 = n-1. All three of these will be relatively prime to nn, since two numbers xx and yy are relatively prime if and only if xyx-y is relatively prime to xx. In this case, 11, 22, and 33 are all relatively prime to nn, so a=n2a = n-2 works.
Now we simply count all nn that are not multiples of 22 or 33, which is easy using inclusion-exclusion. We get a final answer of 998(499+333166)=332998 - (499 + 333 - 166) = \boxed{332}.

Note: another way to find that (a1)(a-1) and (a+1)(a+1) have to be relative prime to nn is the following: start with apaq≢±(pq)(modn)ap-aq \not \equiv \pm(p-q) \pmod n. Then, we can divide by pqp-q to get a≢±1a \not \equiv \pm 1 modulo ngcd(n,pq)\frac{n}{\gcd(n, p-q)}. Since gcd(n,pq)\gcd(n, p-q) ranges through all the divisors of nn, we get that a≢±1a \not \equiv \pm 1 modulo the divisors of nn or gcd(a1,n)=gcd(a+1,n)=1\gcd(a-1, n) = \gcd(a+1, n) = 1.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: NuminaMath-1.5, licensed Apache-2.0. Statement and solution reproduced as published; topic and difficulty added by this site.