The trick, it seems, is to solve puzzles -- sudoku, for example. But by far the most effective puzzle was five-letter anagrams.
The reason for this, the researchers say, is that puzzles engage the brain just enough. The abstract from the study "Going Gaga: Investigating, Creating and Manipulating the Song Stuck in My Head" states:
"The return of intrusive songs depended on cognitive resources: people reported that intrusive songs returned during low cognitive load activities, and we found that overloading the cognitive systems with challenging activities increased intrusive song frequency."
So if I start humming "It's A Small World", you now know what to do.
Zz.