According to music psychologist Ira Hyman, who recently published a paper on earworm science in the journal Applied Cognitive Psychology, songs function much like puzzles in our brains: Music is catchy because its patterns and rhythms engage our minds like a crossword puzzle would. Listening to it -- really hearing songs' lyrics, particularly when they come in the form of a repetitive chorus -- requires some concentration, but not much of it. The stylings of Carly Rae Jepsen (and Beyoncé, and Rihanna, and Gaga, and The Beatles) fall into that cognitive sweet spot of attention and inattention, making them especially sticky. Oh-oh-oh.

Music is different from puzzles, though, in one significant way: While puzzles can be solved -- the crossword gets filled in, the anagrams get de-jumbled -- songs have no obvious solution. So they stay. And stay. And stay. Haunting and taunting and put-a-ring-ing in our ears.

But there may, scientists say, be a way to stop them. Hyman and his colleagues figured that if earworms function like puzzles, they might be vanquished by puzzles, too. After conducting tests on a group of (hopefully extremely well-compensated) test subjects, the researchers determined that cognitive subterfuge is the best way to rid the mind of sticky songs. To defeat an earworm, they suggest, you just have to fool your brain into solving another puzzle -- a non-musical puzzle. The best way to do that? Give it actual puzzles to concentrate on. Do a quick crossword. Tackle an anagram. Spend a few minutes, even, reading a novel. Replace the earworm with another worm, tricking your mind out of its need to finish what it started by giving it something else -- something simple, but not too simple -- to focus on.

Solving anagrams might not always be the best way to spend your time, sure. But it's a small price to pay. And -- this is crazy -- much, much better than having "Call Me Maybe" stuck in your head all day.

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.