# Mathematical problem with square numbers in the decimal system

Moderator Note: this is a question from the Federal Mathematics Competition 2013.

Good morning, here's another (pretty difficult) mathematical problem... The task may sound a little strange (I'm from Germany), but I hope you don't mind :)

Anja and Bernd are playing the following game: They alternatingly write down digits on the blackboard. Anja starts. Every additional digit is written down either to the right or to the left of the digits already written on the blackboard. Prove that Anja can prevent the line of digits (including any leading zeros) from representing a square number in the decimal system after any move by Bernd.

Thank you for good answers (at least I hope so)

Markus

-
I suppose you mean Anja can prevent a square nukber from appearing after any step of Bernd, not just after one step. And that the game goes on forever. –  Marc van Leeuwen Jan 5 '13 at 10:58
What are your thoughts on this? What have you done, have you tried some examples...? –  DonAntonio Jan 5 '13 at 10:59
yes it has to be after any step of Bernd... i translated it wrong :/ –  user55214 Jan 5 '13 at 11:47
she could add for example a 5 at the right side... there's no square number from 50 to 59... –  user55214 Jan 5 '13 at 11:53
oh no, that doesn't work... 256 is a square number :/ –  user55214 Jan 5 '13 at 11:54

There are no squares ending $2$ or $3$. Thus if Anja adds a $2$ or a $3$ on the right, Bernd would also have to add a digit on the right to form a square. If $n$ has at least $2$ digits, $n^2$ and $(n+1)^2$ differ by more than $20$. Thus, given any number, at most one of adding a $2$ or a $3$ on the right allows Bernd to form a square, since otherwise the two squares would differ by less than $20$. Thus Anja can write a $5$ in her first move, as you pointed out, and from then on she can always choose at least one of $2$ or $3$.