AFAIK, we&#x27;ve long solved this one: a song gets stuck in your head from lack of &quot;closure&quot;—trying to complete a pattern. You likely heard the beginning of the song, and that set off your mind trying to remember the rest, but you can&#x27;t remember the ending, so it just keeps spinning on it.<p>The easy fix is the unintuitive one: listen to the song. Then, as soon as you&#x27;ve <i>given</i> your mind closure on the pattern, get your mind out of the rut of analyzing the pattern by listening to something else (also to completion.)<p>More precisely, the experience of having a song stuck in your head is strongly analogous to the experience of having been half-told a joke. You&#x27;ve sort of allocated a mental context buffer and it&#x27;s waiting around to receive the rest of the context, so that it can then evaluate the &#x27;punchline&#x27;. The simplest way to discard the buffer (&quot;ruin the joke&quot;) is to just get the punchline early, without the rest of the context. If you go through a bit of music theory, you can recognize a song as a pattern of building and releasing tension. You could actually <i>just</i> listen to the part of a song that finally releases the tension—closes the matching parenthesis to the opening one your mind is stuck on—and that would do the trick. Listening to the <i>whole</i> song is just easier.