I'm trying to derive a formula for the number of distinct bracelets made up of n beads (n prime ), with k possible colors for each bead, if the permitted symmetries consist of rotations and refections.

Rotations:

The identity element fixes colorings and the other rotations fix k colorings.

Reflections:

Each reflection about the n beads fixes colorings.

So the number of distinct bracelets is

Firstly, is this correct? And secondly, why does this formula not work if m is an odd composite?