PROJECT EULER · #0611
Hallway of Square Steps
Peter moves in a hallway with
- First, he walks a positive square number of doors away from his position.
- Then he walks another, larger square number of doors away from his new position.
- He toggles the door he faces (opens it if closed, closes it if open).
- And finally returns to door
.
We call an action any sequence of those steps. Peter never performs the exact same action twice, and makes sure to perform all possible actions that don't bring him past the last door.
Let
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.