Given a positive integer , consider the following process:
Place stones at position on the real line, and initialize .
If there are stones at position , move stones from position to position , and move another stones from position to .
Increment and return to Step 2.
For some values of this process terminates; for others it continues indefinitely. In either case, there is a finite set of singleton stones that are left behind at each position where was odd. A singleton is lonely if it is at least distance from any other singleton. We call a positive integer sad if all singletons left behind are lonely.
The first sad integer is , trivially. The second is , which leaves behind singletons at positions . The third is , which leaves behind only two singletons at positions and .
Define to be the sum of all sad integers which leave behind singletons only at positions . For example and .
Find .
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.