Sounds like what is commonly called 'earworms'. I have mild OCD, but sometimes the earworms get worse when I'm stressed or anxious or attempting to think hard on something.
I've had a few suggestions that occassionally help. Play White Noise/Nature Sounds at night and attempt to focus on that to to relax. I got a 20 hour one from the iTunes Store so it can play all night. Doesn't personally work for me during the day. Also, I try to only focus moderately on something. Mildly tough puzzles are recommended. If I attempt to focus or think to hard theybstart again.
Some try to replace them by playing another song that will cause an earworm.
You have my sympathies!