Ages of Er and Onan
Question
According to Genesis 38, Judah begat Er, Onan, and Shelah, and Er and Onan grew up old enough to marry Tamar before they died. Then Judah had two sons by Tamar, Perez, and Zerah, the former who grew up old enough to beget Hezron and Hamul, whom he entered Egypt with after Jacob.
But what's the problem? There isn't enough time for all that! According to Genesis 38:1, Judah moved near Hirah the Adullamite "at that time." What time? Well, the previous chapter tells us. According to Genesis 37, Joseph was seventeen, and the Medanites had sold him to an Egyptian named Potiphar. So that's the front-end. What about the backend? Joseph's brothers arrived in Canaan in the second year of the seven years of famine, according to Genesis 45:6, 28. And we know that Joseph was 39 at that time because of Genesis 41:46, which states that Joseph was 30 when he entered the service of the Pharoah. Joseph lived throughout the 7 years of plenty and 2 years into the years of famine, making him 39. Between Joseph's 17th and 39th years of life are 22 years, which is thus our window for the events of Genesis 38.
The youngest possible age that a male can discharge is 11 years old. Let's say Er was born in Joseph's 17th year and married Tamar at 11 (Joseph's 28th year) before dying the same year. Then, let's say Onan was born in Joseph's 18th year and that he married Tamar also at 11 (Joseph's 29th year) before dying the same year. So if Shelah was born in the 19th year, he was only 10—too young. Thus, Tamar seduced Judah, and then Perez and Zerah were born in Joseph's 30th year. This only gives us 9 years for Perez to grow up before he moves to Egypt, so he's too young to have a kid, let alone two.
I'm sure Jews for the last 4000 years noticed this and have had an explanation; I just don't know what that explanation is.