What values of the Standard Model hypercharges result in a mathematically consistent quantum field theory? We show that the constraints imposed by the lack of gauge anomalies can be recast as the equation x^3 + y^3 = z^3. If hypercharge is quantised, then x, y and z must be integers. The trivial (and only) solutions, with x=0 or y=0, reproduce the hypercharge assignments seen in Nature. This argument does not rely on the mixed gauge-gravitational anomaly, which is automatically vanishing if hypercharge is quantised and the gauge anomalies vanish.