Skip to main content

2012 AIME I Problem 15

Problem 15 of 15HarderNumber Theory

There are nn mathematicians seated around a circular table with nn seats numbered 1,1, 2,2, 3,3, …,\ldots, 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 (1)(1) 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); (2)(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<1000.1 \lt n \lt 1000.

Your answer

Integer from 0 to 999
Show solution

Solution

Condition (1)(1) requires the seats a,a, 2a,2a, …,\ldots, nana to be pairwise distinct modulo n,n, which happens if and only if gcd⁡(a,n)=1.\gcd(a, n) = 1. For condition (2),(2), the two mathematicians from seats ii and jj have gap counts before the break determined by ±(i−j) mod n\pm(i - j) \bmod n and after the break by ±a(i−j) mod n,\pm a(i - j) \bmod n, so the requirement is a(i−j)≢±(i−j)(modn)a(i - j) \not\equiv \pm(i - j) \pmod{n} for all i≠j.i \ne j. Equivalently, (a−1)(i−j)≢0(a - 1)(i - j) \not\equiv 0 and (a+1)(i−j)≢0(modn)(a + 1)(i - j) \not\equiv 0 \pmod{n} for every nonzero residue i−j,i - j, which holds exactly when a−1a - 1 and a+1a + 1 are also relatively prime to n.n. So nn is possible if and only if some aa satisfies gcd⁡((a−1) a (a+1), n)=1.\gcd\big((a - 1)\,a\,(a + 1),\, n\big) = 1. Any three consecutive integers include a multiple of 22 and a multiple of 3,3, so no aa works when gcd⁡(n,6)>1.\gcd(n, 6) \gt 1. Conversely, if gcd⁡(n,6)=1,\gcd(n, 6) = 1, then a=3a = 3 works, since 2⋅3⋅4=242 \cdot 3 \cdot 4 = 24 has only the prime factors 22 and 3.3. The valid nn with 1<n<10001 \lt n \lt 1000 are those congruent to ±1(mod6),\pm 1 \pmod 6, namely 6k±16k \pm 1 for 1≤k≤166,1 \le k \le 166, and there are 2⋅166=3322 \cdot 166 = 332 of them.
AoPS wiki

Tagged: modular arithmetic · greatest common divisor

More practice