“So all the generations from Abraham to David are fourteen generations; and from David until the carrying away into Babylon are fourteen generations; and from the carrying away into Babylon unto Christ are fourteen generations. (Matthew 1:17)”
The most likely explanation is that this is a case of gematria (pronounced gem-OTT-tree-uh). Hebrew and Greek letters also served as numbers. The letters in David’s name can also be added up to the number fourteen. Thus Matthew was trying to frame his genealogy to show that Jesus was the true Jewish King—the son of David (v.1).