So the general idea is to find with compass and pencil the exact needed separation angle that can be used to bounce around the interior circumference of a circle with perfect overlap.

You then join up the bounces to their neighbours to get the desired N(prime)-sided polygon.

The easier Heptadecagon (17-sided) was illuminating here:

https://en.wikipedia.org/wiki/Heptadecagon