# Haisu: MathGrant

HAISU is a portmanteau of three Japanese words - 'hairu', to enter, 'su', number, and 'hausu', an English borrow word meaning house, of course.
Together, we get a meaning of 'enter number house', which I have roughly translated to English as 'Room Count'.

The rules are simple - draw a path from the O to the X, passing through every cell in the grid exactly once. The grid is divided into several rooms. When your path passes over a cell with the big number N, it must be the Nth time you have entered the room. If a room has a small number m in the top left corner, you must enter that room a total of m times. An example Haisu puzzle and its unique solution are shown below.

Hopefully that example puzzle clarifies the rules.

I made the puzzle below based on a fellow puzzler's logo. The shading doesn't mean anything, it's just part of the original design.
It turned out to be quite a difficult and interesting puzzle, so I've decided to post it here anyway! Enjoy :)

EDIT: The puzzle has now been changed fairly drastically past the opening steps. Apologies to those who spent extended periods of time on this question. Stackreader's and Trenin's progress still stand! It's just the later steps of the puzzle which have changed. Once again, super sorry, and this version has DEFINITELY been checked many times to make sure that it DEFINITELY works!!!

• Oh damn... I will press the back button and pretend I didn't see this puzzle... It's fun as hell but took me like 4 hours to write the proof when I solved your last one. XD – stack reader Feb 23 '17 at 10:23
• Are you sure it is solvable? Maybe I'm just being stupid but I cannot find a single way to do the "4" at the bottom left. – stack reader Feb 23 '17 at 10:53
• @stackreader I've practically given up logic. Guess and check is hopeless as well, but I've still not found a contradiction for the bottom left four. – Wen1now Feb 23 '17 at 11:15
• The puzzle is definitely solvable. Just double checked. – TheGreatEscaper Feb 23 '17 at 11:27
• "The puzzle is definitely solvable." Except when it isn't. :) – Rubio Feb 24 '17 at 7:40

Starting over since the puzzle changed.

The main things from before are the same - the corners are all known, and the 4 pentomino still has the same logic. Here is what we have.

There are two choices for the order of the remainining cells of the 4 pentomino. We can either hit the top one first and then loop around the origin to hit the other, then come all the way back around to the 3. We need to ensure there is enough room to get to the X.

Alternatively, we can go to the bottom one first and then make one path around to the top one, then into the 3 and around to the X.

Lets assume the second scenario. Thus:

Lets look at the S pentomino with both a 1 and a 2 in the top right hand corner. Clearly, we need to hit the 1 cell immediately when we enter, leave, re-enter and then hit the 2 cell. If we do so on the red path, we will need to enter the pentomino to the left of the 1, go through the 1 and then exit somewhere. Re-enter at the 2 and the follow the corner around. The problem with this is that we will then enter the top pentomino with a 3 in the 3 cell for the first time. Perhaps if our path took us through this pentomino a couple of times first?

The following is one attempt.

The problem with this is obviously, there is no path to the finish from the 4, neither the 5 nor 2 are satisfied. Attempts to fix this on the left side are impossible because we need to keep the path that connects to the 4 pentomino around the perimeter.

Similar failures await if we try to reconcile this with the blue path.

Thus, we are forced to try the other scenario.

Clearly, the red, green, and orange paths are fairly decided on the right hand side in certain spots. Also, because we are entering the top of the 4 pentomino first, the path through that cell is also decided. We also can see that we can extend other paths as a result.

The orange path cannot touch the 1, since this is not the first time in that pentomino. By going far enough to avoid it other lines are extended as well.

In order to enter-reenter the two pentominos on the bottom, we need to move the orange line up and make room.

Now we can see that there aren't very many entrances into the large block with the 5 yet, so the orange line must go through it. Also, we must enter the top one twice before we return through it on the green line. Lastly, the bllue line must traverse the 1 first since there are no other ways to connect it.

It is a simple matter to finish it off in the only way possible.

• Your solution can't possibly be correct. The 1 in the T-shaped region is visited on the SECOND trip into the room. – edderiofer Feb 25 '17 at 13:09
• The solution can be made valid by changing the path at the end of the blue segment. If the path makes a right, up, left there the solution will work. – w l Feb 27 '17 at 9:14
• @edderiofer You are right. I think I saw that at one point, but had to re-do the solution to show all my steps and missed it the second time around. Thanks! I will correct when I have time. – Trenin Feb 27 '17 at 12:44

Here is step 1, I will add more as I go.
Odds are I will run out of time and can't finish it though.

There is only 1 way to do the 4 at the bottom left.
We must enter the room 4 times before stepping on the middle square.
We need 1 side to enter and 1 side to exit. So we must find a way to enter the room 3 times by only blocking 2 sides of the "4" square. So we must enter at least one time in the room, without blocking 1 side, which is only doable by the little loop to the bottom right.

• I'm not going to confirm or deny whether your progress is correct or not, but if you ever have a statement like 'there is only one way to'... you should prove it to yourself, even if you don't need to write it up formally. So maybe double check this :) – TheGreatEscaper Feb 23 '17 at 12:15
• @TheGreatEscaper Is that enough for an explanation? Either way I am out of time, so someone else is probably gonna have to finish it. – stack reader Feb 23 '17 at 12:22
• What's stopping the top square of the F pentomino being entered from the top and the right? I don't think all of your lines are logically deducible. – TheGreatEscaper Feb 23 '17 at 12:31
• @TheGreatEscaper You are right, I edited. It was fun, thanks, but I'm out of time. – stack reader Feb 23 '17 at 12:38
• No worries! Go deal with more important things :) This is definitely the most difficult Haisu puzzle I've made so far, so don't feel too bad about making little progress. – TheGreatEscaper Feb 23 '17 at 13:09

Pah - Just read that there's an error in the question. I've been struggling to crack it for a while. Here's my best effort so far:

I've not added the steps I followed as it's not complete yet. Hopefully it's close to the intended answer and will only take a little modification when the update is posted.