MathDB
Two player game involving summing squares

Source: South African Mathematics Olympiad 2021, Problem 6

August 11, 2021
gamecombinatoricsnumber theory

Problem Statement

Jacob and Laban take turns playing a game. Each of them starts with the list of square numbers 1,4,9,,202121, 4, 9, \dots, 2021^2, and there is a whiteboard in front of them with the number 00 on it. Jacob chooses a number x2x^2 from his list, removes it from his list, and replaces the number WW on the whiteboard with W+x2W + x^2. Laban then does the same with a number from his list, and the repeat back and forth until both of them have no more numbers in their list. Now every time that the number on the whiteboard is divisible by 44 after a player has taken his turn, Jacob gets a sheep. Jacob wants to have as many sheep as possible. What is the greatest number KK such that Jacob can guarantee to get at least KK sheep by the end of the game, no matter how Laban plays?