"So all the generations from Abraham to David are fourteen generations; from David to the deportation to Babylon, fourteen generations; and from the deportation to Babylon to the Messiah, fourteen generations."There is a rarely noticed problem with this verse; sequences two and three have fourteen generations each but sequence one has only thirteen. This is then inconsistent with verse 17 above. Debate has swung back and forth for two thousand years; no solution to this apparent problem is in sight.
If we take the larger period mentioned in verse 17 as a statement of known fact, rather than a summary of verses 2-16, then we'd have a certain number of years to reckon with (e.g., 40 x 14 = 560 years and so 560 x 3 = 1680 from Abraham to Christ ... whatever the definition of a generation was in the time of the apostle Matthew).
If true, then Matthew or the Rabbis might have simply divided the known period into 42 generations and at each break taken the name which there appeared. Thus the selection of the names which appear in the text would be there by default not choice.
This might justify counting the twins (Perez and Zerah) in verse three as two generations rather than a single generation as is universally done.
Perhaps prophetically, the revelation here is that things take place in God's reckoning of history with a fixed chronological sequence ... that is "fourteen generations" each as time rolls on.
Most likely, the methodology for structure in this passage has been lost.