It's not an exact science and there's no formula from what I understand. A motor has three wires, and a 12 pole motor can have either 12, 13 or 14 magnets and few or many stators. A 14 pole can have 14, 15 or 16 magnets. If you find a good explanation or possibly a formula, I'd like to learn it. To this day I haven't been able to find one.