Researchers at Dartmouth College looked into why a certain tune will replay in our head. It's in the auditory cortex. They used brain scans for the study. The researchers would delete nine seconds from a tune, in the case of a catchy tune the cortex would fill in the blank.
http://www.npr.org/templates/story/story.php?storyId=4533543
http://www.paktribune.com/news/index.php?id=97532
http://www.npr.org/templates/story/story.php?storyId=4533543
http://www.paktribune.com/news/index.php?id=97532