Western classical music typically uses twelve distinct notes: C, C#, D, D#, E, F, F#, G, G#, A, A#, B. After this, you hit an octave and repeat.
It always bugged me: why twelve?
Here I try to provide an answer with a few rules and a few graphs. This is a little hand wavy, I’m sure that it’s not original, and I know someone who knows more could make this more convincing and more rigorous.
But this is the internet. Who cares?