In Megillah Esther it is said that the word Hamelech is a indirect reference to Hashem.
Is there a word Hamelech or Melech in the Torah that is a reference to Hashem?
Only in the five Books of Moses i’m Asking on.
Looking through a list of all of the occurrences of Melech in the Torah (really Tanach), here two possibilities:
לֹֽא־הִבִּ֥יט אָ֙וֶן֙ בְּיַעֲקֹ֔ב וְלֹא־רָאָ֥ה עָמָ֖ל בְּיִשְׂרָאֵ֑ל י״י֤ אֱלֹהָיו֙ עִמּ֔וֹ וּתְרוּעַ֥ת מֶ֖לֶךְ בּֽוֹ׃
He has not seen iniquity in Jacob. Neither has he seen perverseness in Israel. Hashem his God is with him. The shout of a king is among them.
Bamidbar 23:21, Alhatorah translation - Melech is interpreted by many mefarshim, as well as Onkelos, to refer to Hashem.
וַיְהִ֥י בִישֻׁר֖וּן מֶ֑לֶךְ בְּהִתְאַסֵּף֙ רָ֣אשֵׁי עָ֔ם יַ֖חַד שִׁבְטֵ֥י יִשְׂרָאֵֽל׃
He was king in Jeshurun, When the heads of the people were gathered, All the tribes of Israel together.
Devarim 33:5, Alhatorah translation - Rashi, among some others, understands this to mean Hashem.
Relatedly, Ibn Ezra (in his introduction to the Megillah) questions the assumption that Makom can refer to Hashem, being that in his opinion, it never refers to Hashem elsewhere in Tanach.
והנה אין במגילה הזאת זכר השם והיא מספרי הקודש. ורבים השבו, כי הוא: ממקום אחר וזה איננו נכון, כי לא נקרא השם מקום בכל ספרי הקודש, רק נקרא מעון, שהוא לעולם גבוה. וקדמונינו זל קראוהו מקום, בעבור שכל מקום מלא כבודו. ועוד, מה טעם למלת אחר.
Behold, there is no mention of the Name [of G-d] in this scroll, and it is one of the holy books! Many have responded that it is [mentioned]: “[relief and salvation will arise for the Jews] from another place” [mimakom acher]. (Esther 4:14) This is incorrect, because Hashem is not known as Makom in any of the holy books, only as Maon [Residence], which is always lofty. Our Sages of blessed memory called Him Makom [“place”], since all places are filled with his honour. Further, what would be the meaning of the word “another” [in mimakom acher]?