Given the number $n$. Two players alternate turns. In each turn player can replace $n$ with $n-1$ or $\lfloor \frac{n}{3} \rfloor$. Player who writes $0$ wins. Decide for which $n$ second player has the winning strategy.
I know Sprague-Grundy function for this game should be periodic but I'm not sure how to determine that period.
Any help would be much appreciated.