Two numbers whose difference is a full square are called friendly numbers. For example, the numbers $25$ and $16$ are friendly because their difference is $9$ full squares. Find the smallest natural number $n$ so that when we randomly paint the numbers $1, 2, 3, ..., n$ in three different colors, there are two friendly numbers of the same color.
I could not solve this question
For $1\le k\le n-25$, numbers $k+9,k+16$ must have a different colour than $k$ and also different than $k+25$ and also $k, k+25$ must differ. We conclude that $k+9,k+16$ have same colour.. Then $k+8$ differs from $k+9$, $k+7$ differs from both $k+8$ and $k+16~k+9$, i.e. the three consecutive numbers $k+7,k+8,k+9$ use the three colours. If $n\ge33$, this holds for $k=1,2,\ldots,8$, so that numbers $8,9,\ldots,17$ cycle through the colours. In particular, $8$ and $17$ have sisme colour - contradiction! Can you solve the puzzle with $n=32$?