An infinite number of people (numbered , , , etc.) are lined up to get a room at Hilbert's newest infinite hotel. The hotel contains an infinite number of floors (numbered , , , etc.), and each floor contains an infinite number of rooms (numbered , , , etc.).
Initially the hotel is empty. Hilbert declares a rule on how the th person is assigned a room: person gets the first vacant room in the lowest numbered floor satisfying either of the following:
the floor is empty
the floor is not empty, and if the latest person taking a room in that floor is person , then is a perfect square
Person gets room in floor since floor is empty.
Person does not get room in floor since is not a perfect square.
Person instead gets room in floor since floor is empty.
Person gets room in floor since is a perfect square.
Eventually, every person in the line gets a room in the hotel.
Define to be if person occupies room in floor , and if no person occupies the room. Here are a few examples:
Find the sum of all for all positive and such that and give the last digits as your answer.
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.