You (maybe?) have thousands of ancestors from the 1600s

I usually think about lineages from the perspective of the ancestor. E.g. my grandpa had 5 kids; those 5 kids produced 9 grandkids; those 9 grandkids produced 3 great-grandkids (so far); 17 descendants in total.

Over the last few days, I've been having fun thinking about the situation in reverse, from the perspective of the descendant. Here's a quote from Genes: A Very Short Introduction by Jonathan Slack:

Also, when considering 'roots', some of the basic mathematics of inheritance needs to be borne in mind. With fully random matings the number of your ancestors doubles every generation. Ten generations ago (250-300 years) we might expect about 1,000 ancestors each contributing 0.1 percent of their total variants to your genome... when the number of ancestors exceeds 2,000-3,000 (12 generations would be about 4,000), it is likely that some ancestral sections of DNA have been lost altogether... by about 15 generations back many of the ancestors contribute no DNA variants at all but they are still ancestors on the lineage. So, even though we all have an ancestry running back to the origin of life on Earth, we do not necessarily have any DNA variants from most of our ancestors.

There's probably a point when the numbers get nonsensical, right? We double the number of ancestors every generation. At what point does the number of ancestors exceed the number of humans that were probably alive at that point in time? I will surely mess up the math, but let's give it a shot. Slack (the author, not the blackhole of knowledge) says that ten generations ago is 250-300 years, so let's take the low value (250) and assume 25 years between each generation. We'll also assume that you were born today (happy birthday!):

Year of birth # of generations before you # of ancestors
1998 1 (parents) 2
1973 2 (grandparents) 4
1948 3 (great-grandparents) 8
1923 4 16
1898 5 32
1873 6 64
1848 7 128
1823 8 256
1798 9 512
1773 10 1,024
1748 11 2,048
1723 12 4,096
1698 13 8,192
1673 14 16,384
1648 15 32,768
1623 16 65,536
1598 17 131,072
1573 18 262,144
1548 19 524,288
1523 20 1,048,576
1498 21 2,097,152
1473 22 4,194,304
1448 23 8,388,608
1423 24 16,777,216
1398 25 33,554,432
1373 26 67,108,864
1348 27 134,217,728
1323 28 268,435,456
1298 29 536,870,912
1273 30 1,073,741,824

If my calculations are correct, which they surely are not, then it seems like the math stops making sense around 1300. Estimates of historical world population says that the world population around 1300 was between 300M and 500M, whereas my hilariously flawed logic says that I should have more than 1B ancestors at that point.

Regardless, I'm pretty sure the basic premise holds: you've got a lot of ancestors.

Edit: Updated the title from You have thousands of ancestors from the 1600s to You (maybe?) have thousands of ancestors from the 1600s to reflect multiple comments from the Hacker News discussion of this post along the lines of "the real world situation is much more complicated".