Definitely sounds like OCD to me. I have it--got the same problem with the numbers. And the repeating in the head--weird thoughts that you don't mean, etc.
Usually goes hand in hand with depression--do you have that, too?
It can drive you nuts........
Got to shout in your head "Stop it" as much as you can so you don't keep repeating things in your mind over and over........