Stone Game IV

Alice and Bob take turns playing a game, with Alice starting first.

Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any square number of stones from the pile (i.e., 1, 4, 9, 16, ...). The player who cannot make a move loses the game (i.e., when the pile has 0 stones and it's their turn).

Given n, return true if Alice wins the game, assuming both play optimally.

Examples
Input: 1
Output: true
Hints

Stone Game IV

Alice and Bob take turns playing a game, with Alice starting first.