Math class never seemed so addictive.