# Puzzlegrid: 5 levels

Those are the warmups. Here's the real challenge.

And yes, it is uniquely solvable.

• Are we guaranteed that no puzzle comes in it's solved state? I.e puzzle 1 is not already solved. Commented Mar 6, 2017 at 11:25
• Additionally, are we guaranteed that levels 1-4 have unique solutions? Commented Mar 6, 2017 at 11:33

That was a nice puzzle. It took a while to get on track, but when it clicked everything got a lot easier.

To allow others to try, my solution will get progressively more hintier, starting with two things I tried that didn't work:

Forming a path through every cell - this quickly becomes impossible on level 4. If you colour the cells like a checkerboard, there's 11 of one parity and 9 of the other, a difference of 2, but since you alternate parity with each move the difference should be at most 1 for a solution to exist.

Splitting the areas into 2 congruent parts. I tried ignoring the fact that level 1 is only one square and noted that all other levels had an even number of squares. There's a unique way to split level 3 into two disjoint congruent areas (both areas need to be disconnected for this to work), but it was impossible to do the same for level 4.

Here's the third thing I tried:

Failing the above, I noticed that the number of white squares in level N is divisible by N. Specifically, the levels have 1, 2, 6, 20 and 60 squares respectively. I thus tried to split level N into N congruent areas, which also failed.

That was close, and led to the key to the puzzle:

Looking up 1, 2, 6, 20, 60 on OEIS reveals that this is sequence is the total number of squares covered if you take all N-ominoes for a given N. For example, there are 5 unique tetrominoes (counting reflections/rotations as the same), and 5*4 = 20. Ditto for 12 pentominoes giving 12*5 = 60. The obvious thing to do now is split up the areas into one of each polyomino.

Here are the solutions to the first 4:

And here's the 5th:

## Working out (partial)

I'm finding it very hard to succinctly show working without it turning into a case bash, so here's a partial working out. I'll try to stick to the following colour order when filling:

Let's try starting with the plus piece, since that's rotationally symmetric. There's only three places it can go since all other positions fence off chunks which aren't a multiple of 5 squares in size:

The red outline spot is easy to rule out:

By looking at places where the 5-long piece can go, here's roughly why it can't be the orange spot (click for full size):
So the plus piece must be on the left, which also locks in an L-shaped piece further left of it.

I'd continue, but this took a very long time to draw and there's a lot more case bashing left, so I think I'll just say you get the gist of it by now :) (I'd show uniqueness but this took much longer than I thought). I might continue if I get time some day.

• Proving uniqueness does take a long time :) And on a side note, a Halmiltonian path is different from a Euler walk. What I'm trying to say is that even though level 4 has lots of squares next to an odd number of squares, it may still be possible to have a path that goes through every square. For example take a 2xN grid. Commented Mar 7, 2017 at 7:50
• What program did you use to draw this? Commented Mar 7, 2017 at 7:50
• @Wen1now Ah oops, that was careless of me - indeed I was trying Hamiltonian path. As for drawing, Google Drawing actually. Commented Mar 7, 2017 at 8:14