Generalized topology for resonators having N commensurate harmonics