Yehudah's Precocious Progeny
According to the simple reading, the story of Yehudah and Tamar takes place after Yoseph is sold down the river. Twenty-two years later, the Bnei Israel follow him down to Egypt. In those twenty-two years, the following events take place, more or less sequentially.
1. Yehudah marries Bat-Shua.
2. She bears three sons: Er, Onan, and Shelah.
3. Er grows up and marries Tamar.
4. Er dies.
5. Onan marries Tamar, and dies.
6. Some time passes while Tamar waits for Shelah to grow up. Meanwhile, Bat-Shua dies and Yehudah is consoled.
7. Eventually Tamar realizes that, while Shelah is now old enough to marry her, Yehudah has no intention of giving him to her, or vice versa. So, she arranges to "meet" Yehudah at the crossroad.
8. Peretz and Zerach are born 7 months later.
9. Peretz grows up.
10. Peretz fathers Hezron and Hamul.
11. They all go to Egypt.
The chronology here is difficult. In a period of 22 years, there has to be time for two generations (Er/Onan/Shelah and Peretz) to grow to marriageable age and father children. At maximum, they could be 11, but they must have been younger than this.
Lets be as generous as possible. Assume all pregnancies last seven months and Bat-Shua becomes pregnant again immediately after giving birth. Then there are two years for step 2. We know Peretz and Zerach are premature, and lets assume Hezron and Hamul were also, and twins to boot, so this is another ~14 months. Now assume the "many days" in Bereishit 38:12 is another year, so there are 18 years available for both Shelah and Peretz to grow up. Split it between them and they are, at most, 9 years old. Let Shelah be a more reasonable 13, and Peretz was 5 when he went down to Egypt with his two sons.
Lets look at this from another angle. How old were Er and Onan when they were punished by Hashem? According to the reasoning above they couldn't have been older than Shelah. But, according to Rashi at the beginning of Chayei Sarah, one is not liable to punishment until the age of twenty! So, 14 months for Er and Onan to be born, 20 years for Onan to be liable to punishment, 7 months for Peretz to be born, and the 22 years are used up before Peretz is out of diapers.
So, ignore the simple meaning of 38:1, and perhaps Yehudah got married before Yoseph was sold. At that time Yehudah was about 21. (He's Leah's fourth son, and Yoseph was born 7 years after his parent married, so Yehudah can't be more than about 4 years older.) They'd been back in Canaan for 11 years at this point (17 years less the 6 years Jacob worked for the sheep). Now Yehudah was 10 when they left Lavan, so give him a couple of years to grow up and marry and we have still have Peretz fathering children at 9 or younger.
If we put aside that Rashi, and assume marriages and punishment at 13, and premature babies, then I think things can be squeezed into the 33 years:
1. Yehudah marries Bat-Shua.
2. She bears three sons: Er, Onan, and Shelah.
3. Er grows up and marries Tamar.
4. Er dies.
5. Onan marries Tamar, and dies.
6. Some time passes while Tamar waits for Shelah to grow up. Meanwhile, Bat-Shua dies and Yehudah is consoled.
7. Eventually Tamar realizes that, while Shelah is now old enough to marry her, Yehudah has no intention of giving him to her, or vice versa. So, she arranges to "meet" Yehudah at the crossroad.
8. Peretz and Zerach are born 7 months later.
9. Peretz grows up.
10. Peretz fathers Hezron and Hamul.
11. They all go to Egypt.
The chronology here is difficult. In a period of 22 years, there has to be time for two generations (Er/Onan/Shelah and Peretz) to grow to marriageable age and father children. At maximum, they could be 11, but they must have been younger than this.
Lets be as generous as possible. Assume all pregnancies last seven months and Bat-Shua becomes pregnant again immediately after giving birth. Then there are two years for step 2. We know Peretz and Zerach are premature, and lets assume Hezron and Hamul were also, and twins to boot, so this is another ~14 months. Now assume the "many days" in Bereishit 38:12 is another year, so there are 18 years available for both Shelah and Peretz to grow up. Split it between them and they are, at most, 9 years old. Let Shelah be a more reasonable 13, and Peretz was 5 when he went down to Egypt with his two sons.
Lets look at this from another angle. How old were Er and Onan when they were punished by Hashem? According to the reasoning above they couldn't have been older than Shelah. But, according to Rashi at the beginning of Chayei Sarah, one is not liable to punishment until the age of twenty! So, 14 months for Er and Onan to be born, 20 years for Onan to be liable to punishment, 7 months for Peretz to be born, and the 22 years are used up before Peretz is out of diapers.
So, ignore the simple meaning of 38:1, and perhaps Yehudah got married before Yoseph was sold. At that time Yehudah was about 21. (He's Leah's fourth son, and Yoseph was born 7 years after his parent married, so Yehudah can't be more than about 4 years older.) They'd been back in Canaan for 11 years at this point (17 years less the 6 years Jacob worked for the sheep). Now Yehudah was 10 when they left Lavan, so give him a couple of years to grow up and marry and we have still have Peretz fathering children at 9 or younger.
If we put aside that Rashi, and assume marriages and punishment at 13, and premature babies, then I think things can be squeezed into the 33 years:
Yehudah to reach 13 and marry: 3 yearsbut it remains difficult. And, anyway, how would Rashi reconcile it?
Three sons born: 2 years
Shelah to grow up: 13 years
Tamar denied Shelah: 1 year
Tamar's pregnancy: 7 months
Peretz to grow: 13 years
Fathers premature twins: 7 months
Total: 33 years, 2 months