Maths Olympiad Prep

Library / /22 of 22

Combinatorics Difficulty 7.7 National olympiad, round 2 Prove it South Africa

Marjorie is the drum major of the world's largest marching band, with more than one million members. She would like the band members to stand in a square formation. To this end, she determines the smallest integer nn such that the band would fit in an n×nn \times n square and lets the members form rows of nn people. However, she is dissatisfied with the result, since some empty positions remain. Therefore, she tells the entire first row to go home and repeats the process with the remaining members. Her aim is to continue it until the band forms a perfect square, but as it happens, she does not succeed until the last members are sent home. Determine the smallest possible number of members in this marching band.

Solution

The answer is 10009771000977. Let MM be the number of members of the marching band. We prove by induction that Marjorie's approach always yields a perfect square at some point, unless MM is of the form M=(2a+b)2+2b+1M = (2^a + b)^2 + 2b + 1 (a,ba, b nonnegative integers, 0b<2a0 \le b < 2^a) or (2a+b)2+2a+3b+2(2^a + b)^2 + 2^a + 3b + 2 (a,ba, b nonnegative integers, 0b<2a10 \le b < 2^a - 1), in which case all members are eventually sent home.

This is true for M=1M = 1 (which is not of either form), since the single member forms a 1×11 \times 1 square, and for M=2M = 2 (which is of the form M=(2a+b)2+2b+1M = (2^a + b)^2 + 2b + 1 with a=b=0a = b = 0), in which case the two members form an incomplete 2×22 \times 2 square and are sent home.

For the induction step, suppose that M>2M > 2 and take nn to be the unique positive integer for which (n1)2<Mn2(n-1)^2 < M \le n^2. Then the MM members will stand in an n×nn \times n square, and if Mn2M \ne n^2, then nn members are sent home. We write n1=2a+bn - 1 = 2^a + b, where 2a2^a is the greatest power of 2 less than or equal to n1n-1, and 0b<2a0 \le b < 2^a. We claim that the process reaches a perfect square if and only if neither M=(2a+b)2+2b+1M = (2^a + b)^2 + 2b + 1 nor M=(2a+b)2+2a+3b+2M = (2^a + b)^2 + 2^a + 3b + 2 (the latter only for b<2a1b < 2^a - 1).

Suppose first that Mn2n+1M \le n^2 - n + 1, so that Mn(n1)2=(2a+b)2M - n \le (n-1)^2 = (2^a + b)^2. By the induction hypothesis, the process never reaches a perfect square if and only if Mn=(2a+b1)2+2b1M - n = (2^a + b - 1)^2 + 2b - 1 or Mn=(2a+b1)2+2a+3b1M - n = (2^a + b - 1)^2 + 2^a + 3b - 1. The former equation is equivalent to M=(2a+b1)2+2a+3bM = (2^a + b - 1)^2 + 2^a + 3b. However, this is impossible since it gives

M=(2a+b1)2+2a+3b=(2a+b)2(2ab1)(n1)2. M = (2^a + b - 1)^2 + 2^a + 3b = (2^a + b)^2 - (2^a - b - 1) \le (n - 1)^2.

The latter equation yields
M=(2a+b1)2+2a+1+4b=(2a+b)2+2b+1, M = (2^a + b - 1)^2 + 2^{a+1} + 4b = (2^a + b)^2 + 2b + 1,
which is what we wanted to prove.

Likewise, if M>n2n+1M > n^2 - n + 1, then Mn>(n1)2M - n > (n-1)^2. So by the induction hypothesis, the process never reaches a perfect square if and only if either Mn=(2a+b)2+2b+1M - n = (2^a + b)^2 + 2b + 1 or Mn=(2a+b)2+2a+3b+2M - n = (2^a + b)^2 + 2^a + 3b + 2. In the former case, we get
M=(2a+b)2+2a+3b+2, M = (2^a + b)^2 + 2^a + 3b + 2,
which is exactly the desired statement. Note, however, that Mn2M \neq n^2 (otherwise, the band forms a perfect square immediately) requires b<2a1b < 2^a - 1. In the latter case, we obtain
M=(2a+b)2+2a+1+4b+3=(2a+b+1)2+2(b+1)>n2, M = (2^a + b)^2 + 2^{a+1} + 4b + 3 = (2^a + b + 1)^2 + 2(b + 1) > n^2,
which is impossible.

This completes the induction. Now note that 1000000=100021000000 = 1000^2 and 1000=29+4881000 = 2^9 + 488, so the smallest number greater than 10000001000000 that is of the form (2a+b)2+2b+1(2^a + b)^2 + 2b + 1 or (2a+b)2+2a+3b+2(2^a + b)^2 + 2^a + 3b + 2 is (29+488)2+2488+1=1000977(2^9 + 488)^2 + 2 \cdot 488 + 1 = 1000977.

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: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic and difficulty added by this site.