(a) RASHI explains that 12 crowns came from the 12 Nesi'im of Yishmael (mentioned at
the end of Parshas Chayei Sarah). Another 23 came from the Alufim of Esav (mentioned
at the end of Parshas Vayishlach), and one crown was the Keser of Yosef.
The SHITAH MEKUBETZES asks that the Alufim of Esav are mentioned in two groups in the
end of Parshas Vayishlach: first, the Torah mentions a group of 14 Alufim, and then
it mentions a group of 11 (with two repeated, as Rashi points out). However, the two
groups cannot be joined together to place their crowns upon the coffin of Yakov,
because, they lived during different periods. The first group were the grandchildren
of Esav. The others, in the second group, ruled only after the dynasty of Esav lost
sovereignty, after the passing of the last of the eight kings who ruled from the line
of Esav (as it says in Divrei ha'Yamim; see Rashi to Bereishis 36:40). In addition,
when the Torah lists the second group of Alufim, it is not mentioning their names,
but rather it is mentioning the places where the Alufim lived (see also RASHASH).
Apparently, Rashi in the Gemara is learning that the Torah is also referring to the
Alufim at the end of the Parshah by their names and not by their places, and,
furthermore, Rashi maintains that these Alufim remained in power even after the last
king of Esav died, while the power of most Alufim of the first group of Alufim waned.
(It is not surprising that Rashi here is explaining differently than what he writes
in his commentary on the Chumash, because Rashi clearly differs here from what he
writes there in other ways, because there (36:5) he writes that there was only one
Aluf of Korach and not two.)
(b) TOSFOS SHANTZ here (and cited in the Shitah Mekubetzes in the name of Tosfos
ha'Rosh), explains that the 36 crowns included 12 of Yishmael and only 14 of Esav
(the grandchildren (the first group of Alufim)). The other 10 were from Bnei Keturah,
who are also mentioned here in the Gemara.
When listing the descendants of Keturah, the Torah (at the end of Parshas Chayei
Sarah) lists six children of Keturah, two grandchildren from one child (Yakshan), and
five grandchildren from another child (Midyan), which totals 13. This, however,
brings the total number of crowns to 39 -- or three too many! The Shitah Mekubetzes
gives two different approaches how to subtract three of them from the count (see
there). (A simple approach might be to exclude the two fathers who had grandchildren,
since they passed on their crowns to their children, and not to count 14 from Esav
but 13, because -- like Rashi on the Chumash says -- the two Korachs were the same
person.)
(c) The VILNA GA'ON (Kol Eliyahu #100) cites the Zohar that explains that the seventy
nations of the world are be divided into two groups -- those who follow the lead of
Yishmael and those who follow the lead of Esav. Perhaps the crowns did *not* include
the descendants of Esav, but only those of Yishmael. (Support for this can be found
in the Midrash Tanchuma, end of Parshas Vayechi. This is logically sound as well,
because Esav attempted to prevent the burial and thus he obviously did not
participate cooperatively with it.) Accordingly, 35 crowns came from the nations that
follow the lead of Yishmael, and the 36th crown was that of Yosef, like Rashi says.
(d) The KEREN ORAH explains the Gemara in an allegorical sense. He explains that the
reason why 36 crowns were placed on the coffin of Yakov Avinu was to hint to his
great spiritual attainment. The Sages point out that there are 36 sins which are
punishable by Kares. Kares -- being cut off from the Shechinah -- is the lowest
spiritual level. Yakov Avinu reached the opposite extreme -- the highest spiritual
level. He was on such a high spiritual level that the Gemara says that "Yakov Avinu
did not die" (Ta'anis 5b). Therefore, he was crowned with 36 crowns to represent the
36 degrees of Kares which he opposed and from which he reached the opposite extreme.
The word "Keser" (crown) is comprised of the letters that spell "Kares," and this
shows that Yakov attained the reverse of the low spiritual level represented by Kares
and achieved the "Keser."