I think your distraction technique works perfectly. Infact I often guide my clients through a similar strategy of occupying the monkey mind with something else when anxiety or overwhelm hits. It works wonders.
And, if I ever use a math problem to calm my anxiety, I'm afraid I would get worse :) Math gives me anxiety!! Beach scenes and serene sounds work better for me :) Just saying!