Cameron became the first serving British prime minister to appear on the late night CBS talkshow on Wednesday (September 26), and was played in with a rendition of 'Rule Britannia' from Letterman's house band.
However, he incorrectly attributed the musical arrangement of James Thomson's poem to Edward Elgar, when it was in fact set to music by Thomas Arne in 1740.
"You have found me out. That's bad, I've ended my career on your show tonight," Cameron joked when told the correct answer.
Letterman also asked him questions about the document known as Magna Carta, which Cameron correctly said was signed in 1215 at Runnymede.
Describing the document as the country's first declaration of legal rights, he was unable to translate the words 'Magna Carta' into English, to which Letterman quipped: "Boy, it would be good if you know this."
Cameron was also quizzed on the nations and regions of the United Kingdom, and found himself correcting Letterman when he himself made an incorrect reference to the British empire.
Other subjects discussed by the pair during a 15-minute conversation included the Arab spring, the Olympics and Paralympics, Cameron's appearance at the United Nations earlier in the week and the country's decision not to join the euro.
However, he declined to endorse a candidate in the forthcoming US presidential elections, saying: "I have got on well with Republicans, I can get on well with Democrats."
Cameron's most positive studio audience reception came when he explained that UK law does not allow political parties to pay for advertising on television, in contrast to the US.
He also said that he was first recognised in America when a passer-by in New York City greeted him with the words: "Hey, Prime Minister's Questions! We love your show."