I love this idea! I'd suggest making the hacking difficulty progressive - like at first you only have one variable to control, then add more as you go on. And build the math lesson part right into the game, one step at a time.