2005 AIME I Problems/Problem 4
Problem
The director of a marching band wishes to place the members into a formation that includes all of them and has no unfilled positions. If they are arranged in a square formation, there are 5 members left over. The director realizes that if he arranges the group in a formation with 7 more rows than columns, there are no members left over. Find the maximum number of members this band can have.
Solution
If then and so . If is an integer there are no numbers which are 5 more than a perfect square strictly between and . Thus, if the number of columns is , the number of students is which must be 5 more than a perfect square, so . In fact, when we have , so this number works and no larger number can. Thus, the answer is 294.