It doesn't appear to be that pervasive. Someone who suffers from OCD may experiance these obsessive thoughts on a regular basis and they interfer with the persons life so much that say they find it hard to get to work because they are counting 300 times a day. It can be very severe.
What your explaining could be little more than the work of a budding mathematician. If it interfers with your life so much it's causing you alot of stress and so on, maybe then it would be a good idea to see a doctor about it.
If not, then i can only see benefits in doing equations when your bored.