Assume a labyrinth layout in the form of chambers. In a certain labyrinth map, there are , chambers in the form of a large square. Now, the chambers were labelled as , row by row, from left to right. Now, say the Minotaur starts in chamber . There is a set of rules for the Minotaur to move through chambers, considering that all the chambers are interconnected.
- If the Minotaur is in in chamber and , then move to the chamber in the row above ().
- If the Minotaur is in in chamber and , then move to the chamber on the right ().
- If the Minotaur is in in chamber and , then move to the chamber in the row below ().
- If the Minotaur is in in chamber and , then move to the chamber on the left ().
- If the directions lead the Minotaur out of the labyrinth, then the Minotaur will scroll to the chamber on the opposite end of the row or column, depending on the direction in which the Minotaur leaves the labyrinth.
- There is no limit to how many times the Minotaur will move.
Say that Theseus is forced to stay in one chamber of the labyrinth. There is a chamber numbered , such that no matter what value is (i.e. the dimensions of the square), the Minotaur will never enter this chamber. Find the value .
I was doodling in my notebook, and realized something interesting.