# The mage's safe

After fighting hordes of undead, slaying several gargoyles and finally dispatching of the evil necromancer himself, the adventuring party finds itself in the treasure vault beneath the mage's tower. There is plenty of gold around, but the one thing the adventurers came for - the magical Sword of Everslay is safely locked away in a transparent magical field in the shape of an icosahedron.

No spell and surely no brute force can break that safe, but in the wall next to the force-field is a metallic board with some numbers engraved and in its center is something the adventurers have never seen in their life: A numberpad!

End of pure flavor text.

## What number needs to be entered in the keypad to unlock the safe? (and why?)

The code is ...

246 [OK]

Because

The numbers in the table are the number of regions you get when you take a polygon of 3 to 7 sides, split the sides equally in 1 to 5 parts and join all the resulting points, except the original corners of the polygon.

If you zoom in on the central picture you get:

After carefully counting the regions by hand, some being really tiny, I arrived at a total of 246 regions.

• How did you work that out?
– PDT
Commented Oct 25, 2020 at 16:45
• I did notice that there is also a hint in the shape of the board: it is the overlay of a triangle, square, pentagon, hexagon and heptagon inscribed in a circle: i.sstatic.net/gcVF6.png (But I had no idea this would be the answer, so well done!) Commented Oct 25, 2020 at 16:48
• I got some help from math.stackexchange.com/questions/3492263/… Commented Oct 25, 2020 at 16:50
• Congrats, that was fast! (PuzzlingSE never fails to impress me). I wasn't sure if this wasn't too hard even with the small hint Reinier above mentioned. I knew, I couldn't use any number-series that might appear in the OEIS, so I had to stay away from A331911 but then wasn't sure if it was too arbitrary. So, was it just chance you've recently seen those values or did you get the idean and just had help with getting the numbers from math.stackechange.com ? Anyway, your picture is actually nicer than the ones I (manually) drew and (manually) counted with Corel. :c) Commented Oct 25, 2020 at 19:48
• OK, I confess. I googled "1, 4, 27, 130, 385". I also searched OEIS and found a sequence about domino arrangements that I coudn't extend to the whole table. Commented Oct 25, 2020 at 19:55