The math behind the circle of fifths