As n>1. The next day, she therefore gives n−1 shells to her sister and is left with n2−n−(n−1)=(n−1)2 shells, again a perfect square. We see that the numbers of shells that Sabine is left with are alternately a perfect square and a number that is not a perfect square.
Let d be the first day that Sabine is left with a number of shells that is a perfect square, say n2 shells. Then days d+2,d+4,…,d+18 are the second to tenth day that the remaining number of shells is a perfect square (namely (n−1)2,(n−2)2,…,(n−9)2 shells). We conclude that d+18=28, and hence d=10.
On day 26 the number of remaining shells is at least 1000, but on days 27 and 28 this number is less than 1000. We see that (n−9)2<1000≤(n−8)2. As 312<1000≤322, we see that n−8=32, and hence n=40. We find that day 10 is the first day that the number of remaining shells is a perfect square, and that this number is 402.
In the remainder of the proof, we will use the following observation.
Observation. On any day, starting with more shells, means that Sabine will have more (or just as many) shells left after giving shells to her sister.
Indeed, suppose that Sabine starts the day with x shells, say n2≤x<(n+1)2. After giving away shells, she will be left with x−n shells. If she had started with x+1 shells instead of x, she would have been left with x+1−n>x−n or x+1−(n+1)=x−n shells.
Let x be the number of shells remaining on day 8. The obvious guess x=412=1681 is incorrect as x cannot be a perfect square. We therefore try x=412−2=412−1, and x=412+1. The table shows the number of shells remaining on day 8, 9, and 10.
We see that the case
x=1679 is ruled out because it would imply that fewer than
402=1600 shells are left on day 10. By the above observation, this also rules out the case
x<1679. The case
x=1682 is ruled out because it would imply that more than
402 shells will be left on day 10. Hence, also
x>1682 is ruled out. The number of shells left on day 8 must therefore be
412−1.
To follow the pattern back in time, we consider the case that the number of remaining shells is just shy of a perfect square. Suppose that on a given day the number of remaining shells is n2−a, where 1≤a<n. Then the following day, the number of remaining shells is n2−a−(n−1). Since a<n, we have n2−a−(n−1)>n2−n−(n−1)=(n−1)2. The day after that, the number of remaining shells must therefore be n2−a−(n−1)−(n−1)=(n−1)2−(a−1).
So if Sabine originally had 452−5 shells, then the number of remaining shells on days 2, 4, 6, and 8 are 442−4,432−3,422−2, and 412−1, respectively. This gives us a solution.
If Sabine originally had 452−4 shells, then she would be left with too many shells on day 8, namely 412−0. The original number of shells could therefore not have been 452−4 or more.
If Sabine originally had 452−6 shells, then she would be left with too few shells on day 8, namely 412−2. The original number of shells could therefore not have been 452−6 or fewer.
We conclude that the only possibility is that Sabine started with a collection of 452−5=2020 shells.