Problem:
Trevor and Edward play a game in which they take turns adding or removing beans from a pile. On each turn, a player must either add or remove the largest perfect square number of beans that is in the heap. The player who empties the pile wins. For example, if Trevor goes first with a pile of 5 beans, he can either add 4 to make the total 9, or remove 4 to make the total 1, and either way Edward wins by removing all the beans. There is no limit to how large the pile can grow; it just starts with some finite number of beans in it, say fewer than 1000.
Before the game begins, Edward dispatches a spy to find out how many beans will be in the opening pile, call this , then "graciously" offers to let Trevor go first. Knowing that the first player is more likely to win, but not knowing , Trevor logically but unwisely accepts, and Edward goes on to win the game. Find a number less than 1000 that would prompt this scenario, assuming both players are perfect logicians. A correct answer is worth the nearest integer to points.