Let be a positive integer. Bernardo and Silvia take turns writing and erasing numbers on a blackboard as follows. Bernardo starts by writing the smallest perfect square with digits. Every time Bernardo writes a number, Silvia erases the last digits of it. Bernardo then writes the next perfect square, Silvia erases the last digits of it, and this process continues until the last two numbers that remain on the board differ by at least . Let be the smallest positive integer not written on the board. For example, if , then the numbers that Bernardo writes are , , , , and , and the numbers showing on the board after Silvia erases are , , , , and , and thus . What is the sum of the digits of ?
This problem is a part of Tessellate S.T.E.M.S. (2019)
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The idea is to show that f ( 2 n ) = 4 1 0 2 n + 1 0 n . Then n = 1 ∑ 1 0 0 8 f ( 2 n ) = 2 5 2 5 ⋯ 2 5 + 1 1 1 ⋯ 1 0 , where there are 1 0 0 8 copies of 25 in the first number and 1 0 0 8 1s in the second number. There are clearly no carries when we sum these two numbers, so the digit sum equals the sum of the digit sums of the two addends, which is 7 ⋅ 1 0 0 8 + 1 0 0 8 = 8 0 6 4 .
To see that x n = 4 1 0 2 n + 1 0 n is not on the board, notice that ( 2 1 0 2 n + 1 0 n ) 2 ( 2 1 0 2 n + 1 0 n − 1 ) 2 = 1 0 2 n ( x n + 1 ) = 1 0 2 n x n − ( 2 ⋅ 1 0 n − 1 ) so chopping off the rightmost 2 n digits from these consecutive squares gives the numbers x n − 1 and x n + 1 .
It's a little bit more painful to see why x n is the smallest number not on the board. There are two steps: first, the squares of any two consecutive numbers less than 1 0 2 n / 2 differ by less than 1 0 2 n , so truncating the rightmost 2 n digits of them will either give the same number or consecutive numbers. Second, it's a straightforward but tedious check that the numbers obtained by truncating the rightmost 2 n digits of the squares of the 1 0 n consecutive numbers 1 0 2 n / 2 , 1 0 2 n / 2 + 1 , … , 1 0 2 n / 2 + 1 0 n − 1 are consecutive integers. (Indeed, they are the integers 1 0 2 n / 4 , 1 0 2 n / 4 + 1 , … , 1 0 2 n / 4 + 1 0 n − 1 . ) I'll leave that to the reader!