Jesus’ ancestry is traced back through David all the way to Adam in Luke 3:23–38. However, Luke’s listing of David’s sons is almost entirely different than the one recorded in Matthew 1:1–17. Two different scenarios can explain this discrepancy.
First, Luke may actually be giving us Mary’s genealogy without mentioning her name since it was not acceptable back then to include women in such lists. Luke’s birth narrative highlights Mary, and Joseph is called Jesus’ “supposed” father (3:23). Matthew, on the other hand, gives us Joseph’s ancestry.
Or, Matthew could have recorded the throne succession while Luke gives the actual, physical parentage of Jesus. David’s throne passed from father to son starting with Solomon (1 Kings 1:28–31). Under levirate marriage laws, a Davidite whose physical forefathers were not heirs to the throne could be adopted into the royal line if the heir by way of natural descent died childless (Deut. 25:5–10). Matthew 1:12, for example, tells us Zerubbabel was Shealtiel’s son even though he was Shealtiel’s nephew (1 Chron. 3:17–19). Perhaps Shealtiel died without having a son and Zerubbabel was adopted as the royal heir due to a levirate marriage. Maybe the right to David’s throne by way of Solomon finally came to Joseph through such marriages even though Jesus’ actual physical ancestor was Solomon’s brother, Nathan (Luke 3:31).
Matthew 1:17 notes that three sets of fourteen generations separate Abraham and the birth of Jesus Christ — a span of about five hundred years versus the two thousand years that really intervened. It is common for biblical writers to omit names in ancestry lists (“the father of” can refer to a remote ancestor), and the evangelist’s focus on “fourteen” is likely intended as an aid for memorization.
Letters were used in place of numerals in the first century, with the Hebrew consonants daleth (d) and waw (w) representing four and six, respectively. David is spelled dwd in Hebrew consonants, which is equivalent to the number fourteen (four plus six plus four). Thus, Matthew’s focus on fourteen generations also emphasizes Jesus’ kingly role as the Son of David.
We are not yet certain why Matthew’s genealogy differs from Luke’s, but this ought not cause confusion. Scripture has been proven trustworthy time and again, and differences such as these cannot be contradictions (Heb. 6:18). Thus, our inability to answer every single question about the Bible is nothing to fear. It is not wrong to admit the limitations of our knowledge, for we rest upon and submit to the knowledge of God revealed in His Word.