Vayikra / Leviticus 12:2 · Remez
דַּבֵּר אֶל־בְּנֵי יִשְׂרָאֵל לֵאמֹר אִשָּׁה כִּי תַזְרִיעַ וְיָלְדָה זָכָר וְטָמְאָה שִׁבְעַת יָמִים כִּימֵי נִדַּת דְּוֺתָהּ תִּטְמָא׃
"Speak to the children of Israel, saying: If a woman conceives and bears a male child, she shall be impure seven days, as in the days of her separation for her monthly sickness she shall be impure.
Remez רֶמֶז
Seven and eight
Some numbers keep coming back in life: seven days of the week, seven days of mourning. Sometimes it is worth asking why that number.
Kitzur Baal HaTurim: the word "male" (זָכָר) equals the word "blessing" (בְּרָכָה) in the numerical value of the letters. Seven days of impurity after birth are like seven days of mourning: as a person came, so he will go. Kli Yakar: seven is the number of nature and eight is above nature, so circumcision is on the eighth day.
How Kitzur Ba'al HaTurim and Kli Yakar explain it
Kitzur Ba'al HaTurim A male
The word "male" (זָכָר) equals the word "blessing" (בְּרָכָה) in the numerical value of the letters.
Kitzur Ba'al HaTurim She shall be impure seven days
And so too the seven days of mourning: as he came, so he will go.
Kli Yakar If a woman conceives and bears a male child
The sages said: if the man gives seed first, a girl is born, and if the woman first, a boy (Niddah 31a). The commentators wrote that this is a matter of nature. But it is hard for me to understand: why tell this in the chapter on the impurity of a woman after birth, seven days for a boy and fourteen for a girl? And what does the commandment of circumcision have to do with it? One could say, it is true, that the Torah wanted to explain why circumcision is set on the eighth day: so that it should not be that everyone rejoices while the father and mother are sad (Niddah 31b), since she has seven days of impurity.
Still, to answer all the questions in one way, I say: all this follows by way of nature from the first sin, as it says: "and she shall be pure from the flow of her blood". For the first sin of Chava (Eve) is the source that opened for this impure blood, as we find: Rav Yitzchak bar Avdimi said: "I will greatly multiply your pain" means two drops of blood (Eruvin 100b). And so it follows from the Jerusalem Talmud: the sin of Chava is the source of this blood. So it says "and she shall be pure from the flow of her blood": all women need purification from the first sin, from which impurity and filth spread through the world and brought seven days of impurity on all who are born.
For had the human not sinned, he would have been like an angel of the Almighty, above the rule of the seven wandering luminaries. But through the sin he lost his spirituality and came under their rule, and from them impurity came to the human. For everything material is subject to the number seven: seven wandering luminaries, seven days of creation. And everything eighth is spiritual, for it is above seven, as explained above, in the portion of Shemini.
Takeaway
Numerical value of the letters: זָכָר = ז 7 + כ 20 + ר 200 = 227, and בְּרָכָה = ב 2 + ר 200 + כ 20 + ה 5 = 227.
"As he came, so he will go" (כְּשֶׁבָּא כֵּן יֵלֵךְ) are the words of Kohelet (Kohelet / Ecclesiastes 5:15). Seven days of mourning for the dead is a custom from ancient times (Bereshit / Genesis 50:10).
"I will greatly multiply your pain" are the words said to Chava after the sin (Bereshit / Genesis 3:16).
The seven wandering luminaries of medieval science are the Sun, the Moon and the five visible planets. They were thought to govern nature.
Kli Yakar already wrote of the eighth day as a step above nature in the portion of Shemini, on the verse "And it was on the eighth day" (Vayikra / Leviticus 9:1).