"And He said: I am the LORD, the God of Abraham your father and the God of Isaac" (Genesis 28:13). Eighteen times the Torah mentions the patriarchs together, and corresponding to this the Sages fixed eighteen blessings in the Amidah prayer. And if a person says to you, "They are nineteen," say to him: "And behold, the LORD stood over him" — that one is not counted among them. And if a person says to you, "They are seventeen," say to him: "and let my name be called upon them, and the name of my fathers Abraham and Isaac" (Genesis 48:16) — that one is one of them. Rabbi Shmuel bar Nachmani said: corresponding to the eighteen commands that are written in the second account of the Tabernacle, from "and with him Oholiab" (Exodus 38:23) until the end of the book. "The land on which you lie" (Genesis 28:13). Reish Lakish in the name of Bar Kappara said: He folded it like a writing tablet and placed it under his head, like a person who says, "What is under your head is yours." Rabbi Huna in the name of Rabbi Elazar said: this was only on condition that he would be buried upon it.
Eighteen Mentions of the Patriarchs and the Eighteen Blessings
Yalkut Shimoni on Torah 120:1
וַיֹּאמַר אֲנִי ה' אֱלֹהֵי אַבְרָהָם אָבִיךָ וֵאלֹהֵי יִצְחָק. שְׁמֹנֶה עֶשְׂרֵה פְּעָמִים הוּא מַזְכִּיר אֶת הָאָבוֹת בַּתּוֹרָה וּכְנֶגֶד כֵּן קָבְעוּ חֲכָמִים שְׁמֹנֶה עֶשְׂרֵה בְּרָכוֹת בַּתְּפִלָּה, וְאִם יֹאמַר לְךָ אָדָם תְּשַׁע עֶשְׂרֵה הֵן, אֱמֹר לוֹ הִנֵּה ה' נִצָּב עָלָיו לֵית הוּא מִנְּהוֹן וְאִם יֹאמַר לְךָ אָדָם שְׁבַע עֶשְׂרֵה הֵן, אֱמֹר לוֹ (בראשית מח, טז) "וְיִקָּרֵא בָהֶם שְׁמִי וְשֵׁם אֲבוֹתַי אַבְרָהָם וְיִצְחָק" הוּא חַד מִנְּהוֹן. רַבִּי שְׁמוּאֵל בַּר נַחְמָנִי אָמַר, כְּנֶגֶד שְׁמוֹנָה עָשָׂר צִווּיִין שֶׁכְּתוּבִים (בְּפָרָשָׁה) מִשְׁכָּן שֵׁנִי מִן (שמות לח, כג) "וְאִתּוֹ אָהֳלִיאָב" עַד סֵיפֵיהּ דְּסִפְרָא. הָאָרֶץ אֲשֶׁר אַתָּה שֹׁכֵב עָלֶיהָ. רֵישׁ לָקִישׁ בְּשֵׁם בַּר קַפָּרָא אָמַר, קִפְּלָהּ כְּפִנְקָס וּנְתָנָהּ תַּחַת ראשׁוֹ כְּאִינִשׁ דְּאָמַר מִן תְּחוֹת רֵישָׁךְ דִּידָךְ הוּא רַבִּי הוּנָא בְּשֵׁם רַבִּי אֶלְעָזָר, וּבִלְבַד שֶׁתִּקָבֵר עָלֶיהָ.