Browse · MathNet
PrintThe South African Mathematical Olympiad Third Round
South Africa counting and probability
Problem
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 such that the band would fit in an square and lets the members form rows of 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 . Let 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 is of the form ( nonnegative integers, ) or ( nonnegative integers, ), in which case all members are eventually sent home.
This is true for (which is not of either form), since the single member forms a square, and for (which is of the form with ), in which case the two members form an incomplete square and are sent home.
For the induction step, suppose that and take to be the unique positive integer for which . Then the members will stand in an square, and if , then members are sent home. We write , where is the greatest power of 2 less than or equal to , and . We claim that the process reaches a perfect square if and only if neither nor (the latter only for ).
Suppose first that , so that . By the induction hypothesis, the process never reaches a perfect square if and only if or . The former equation is equivalent to . However, this is impossible since it gives
The latter equation yields which is what we wanted to prove.
Likewise, if , then . So by the induction hypothesis, the process never reaches a perfect square if and only if either or . In the former case, we get which is exactly the desired statement. Note, however, that (otherwise, the band forms a perfect square immediately) requires . In the latter case, we obtain which is impossible.
This completes the induction. Now note that and , so the smallest number greater than that is of the form or is .
This is true for (which is not of either form), since the single member forms a square, and for (which is of the form with ), in which case the two members form an incomplete square and are sent home.
For the induction step, suppose that and take to be the unique positive integer for which . Then the members will stand in an square, and if , then members are sent home. We write , where is the greatest power of 2 less than or equal to , and . We claim that the process reaches a perfect square if and only if neither nor (the latter only for ).
Suppose first that , so that . By the induction hypothesis, the process never reaches a perfect square if and only if or . The former equation is equivalent to . However, this is impossible since it gives
The latter equation yields which is what we wanted to prove.
Likewise, if , then . So by the induction hypothesis, the process never reaches a perfect square if and only if either or . In the former case, we get which is exactly the desired statement. Note, however, that (otherwise, the band forms a perfect square immediately) requires . In the latter case, we obtain which is impossible.
This completes the induction. Now note that and , so the smallest number greater than that is of the form or is .
Final answer
1000977
Techniques
Induction / smoothingInvariants / monovariants