On the Subject of Modulo Maze

Today’s lottery numbers are: Two, One Four Seven, Four Eight Three, Six Four Seven.

This module consists of 4 arrows and 2 displays. The display at the bottom has a number between 1000000000 and 2147483647. The display on the right represents the goal, where the letter is the column from left to right, and the digit is the row from top to bottom. The color of the module is randomized, but is irrelevant to the solving process.

To solve the module, navigate a maze such that you are on the goal position when the displayed number becomes 0.

When you press an arrow, not only will you move in the maze, the bottom number will change. More specifically, if the displayed number (X) is greater than the number in the space you move to (Y), the displayed number will become X modulo Y. If the displayed number is smaller, the displayed number will become Y modulo X.

Reaching a display of 0 when you're not at the goal position will incur a strike and regenerate the module. Walking into a wall also incurs a strike and regenerates the module, regardless of your position. However, if you move to the goal position and the resulting number is not 0, no penalty is incurred.

There can and will be more than one possible solution to the module.

All mazes are 8x8, and have unique numbers.

To determine the maze used, take the displayed number (upon module generation), and subtract the sum of the digits in the serial number. Take the result modulo 7, and use the corresponding maze.

Then, to determine your starting position, take the displayed number (upon module generation), and subtract the sum of the alphabetic positions of the letters (A1Z26) in the serial number. Take the result modulo 64 to get your starting position in the maze in reading order, with the top-left space being 0.

An example will be provided on the last page.

NOTE: If you are going to copy and paste numbers from the mazes, you will need to double-click the space immediately to the left of that cell. The remedy to this issue is currently not known.

Maze 0

Maze 1

Maze 2

Maze 3

Maze 4

Maze 5

Maze 6

Example

Starting Number: 1686214380 // Serial Number: 3U3TG1 // Goal: G3

1686214380-3-3-1=1686214373 (Subtract the sum of the serial digits)
1686214373%7=4 (Take the result modulo 7; our maze is 4)

1686214380-21-20-7=1686214332 (Subtract the sum of the serial letters) 1686214332%64=60 (Take the result modulo 64; our starting position is 60, or E8)

We are going from E8 to G3 in Maze 4. Possible Solution: UULUDRUUURRRL

Up to E7: 1686214380%392019681=118135656
Up to E6: 789089130%118135656=80275194
Left to D6: 102358468%80275194=22083274
Up to D5: 753929482%22083274=3098166
Down to D6: 102358468%3098166=118990
Right to E6: 789089130%118990=66440
Up to E5: 564353103%66440=11743
Up to E4: 468106264%11743=6798
Up to E3: 769010253%6798=99
Right to F3: 776139513%99=6
Right to G3: 943258238%6=2
Right to H3: 265937349%2=1
Left to G3: 943258238%1=0