ומנין שהתפלל משה באותו הפרק חמש מאות וחמשה עשר פעמים שנאמר "ואתחנן אל ה' בעת ההיא לאמר" ואתחנן בגימטריא הכי הוי.
From where do we learn that Moshe beseeched Hashem at that time with 515 prayers [to be allowed entrance into Eretz Yisrael]? From the verse, “And I prayed (va’eschanan) to Hashem at that time.” The word v’eschanan is the numerical equivalent of 515.
Moshe Rabbeinu earned the distinguished title of “Father of the Prophets.” He was the only person ever to reach the pinnacle of human perfection, as the Rambam writes. He dedicated his life to the service of Hashem, and the welfare of the Jewish people, with no thought at all of his own comfort or personal benefit. How, then, could it be that his 515 prayers went unanswered? Hashem is praised as “He Who hears the prayers of every mouth.” Why did He ignore the prayers of Moshe, His trusted servant?
This question is magnified in light of the following Midrash:
באותה שעה אמר משה לפני הקב"ה רבש"ע גלוי וידוע לפניך יגיעי וצערי שנצטערתי על ישראל עד שיהיו מאמינים לשמך. כמה צער נצטערתי עליהם במצות עד שקבעתי להן תורה ומצות אמרתי כשראיתי בצרתן כך אראה בטובתן ועכשיו שהגיע טובתן של ישראל אתה אומר לי לא תעבור את הירדן הזה הרי אתה עושה תורתך פלסתר דכתיב "ביומו תתן שכרו ולא תבוא עליו השמש כי עני הוא ואליו הוא נושא את נפשו ולא יקרא עליך אל ה' והיה בך חטא", זו היא שילום עבודה של מ' שנה שעמלתי עד שיהיו עם קדוש ונאמן שנאמר "ויהודה עוד רד עם אל ועם קדושים נאמן."
At that time, Moshe said before HaKadosh Baruch Hu: “Master of the Universe, it is revealed and known before You the toil and suffering which I endured until the Bnei Yisrael were made to believe in Your Name. How much difficulty I endured for their sake in teaching them Torah and mitzvos! Just as I endured pain on their behalf, so may I see their good fortune. Now that the time of Israel’s good fortune has at last arrived, You tell me, ‘You shall not pass over the Yarden.’ Would you deny Your own Torah, in which it is written, ‘On the day (of his labor), pay his wages. Do not let the sun set upon him, for he is impoverished, and he sets his soul towards his wages. Let him not cry out to Hashem against you, lest you be found guilty.’ Is this the reward You give me after forty years of working to develop them into a holy and faithful nation, as it is written, ‘Yehudah yet rules over G‑d’s nation: the holy, faithful nation”?
Moshe’s claims were just, and his prayers were heartfelt and sincere. Far be it from Hashem to turn His back on Moshe when Moshe came to claim the reward for all his efforts. Rather, we must explain that Moshe’s prayers were indeed answered, yet in a manner that is unfathomably sublime and transcendent.
The Gemara tells us that prayer stands at the heights of the universe, yet people take it lightly. The Baal Shem Tov explained that people fail to treat prayer with the proper esteem, since they are disappointed when their prayers go unanswered. They pray to Hashem with all their hearts for a certain request, and when that request is not granted, they fall into despair, imagining that their prayers are ignored, and it is fruitless to continue praying, chas v’shalom.
The truth is, however, that no prayer is ever ignored; nor does any prayer ever go to waste. Hashem answers all our prayers in a manner that He alone knows is best for us. Sometimes our prayers are answered directly, and we receive exactly what we asked for. Sometimes we receive something even better, but we are not even aware that it came about as a result of our prayers. For this reason, our Sages tell us that prayer stands at the heights of the universe. It reaches a place in Heaven far loftier than reason can discern. Therefore, we are often unable to understand the correlation between our prayers and the blessing that descends as a result of them. Man may pray on his own behalf, and receive in return blessing for his children or grandchildren for many generations to come. He may pray for honor or riches and receive life itself instead.
Precisely because of the lofty nature of prayer, which stands at the heights of the universe, we are unable to perceive its effects. Therefore, we are apt to take it lightly.
The Midrash states as follows:
גדולה היא התפלה לפני הקב"ה. אמר רבי אלעזר רצונך לידע כחה של תפלה אם אינה עושה כולה חציה היא עושה. קין עמד על הבל אחיו והרגו יצאה גזירה "נע ונד תהיה בארץ" מיד עמד ונתודה לפני הקב"ה שנאמר "גדול עוני מנשוא." אמר לפניו "רבש"ע כל העולם אתה סובל ולעוני אי אתה סובל? כתבת "נושא עון ועובר על פשע סלח לעוני שהוא גדול." מיד מצא חסד לפני הקב"ה ונמנע ממנו נע חצי הגזירה שכן כתיב "וישב בארץ נוד" מכאן אתה למד שגדולה התפלה לפני הקב"ה. וכן חזקיהו בשעה שאמר לו הנביא "צו לביתך כי מת אתה" מיד "ויסב חזקיהו פניו אל הקיר." אמר לן הקב"ה שמעתי את תפלתך וגו' והוספתי על ימיך חמש עשרה שנה שכן כתיב "רצון יראיו יעשה ואת שועתם ישמע ויושיעם."
Prayer is of great significance before HaKadosh Baruch Hu. Rebbe Elazar said: Do you wish to know the power of prayer? If it does not achieve one’s full desire, it will achieve at least half. When Kayin rose up again Hevel and killed him, his sentence was decreed: “And you shall wander and journey (na v’nod) throughout the land.”
Kayin then confessed his sins before HaKadosh Baruch Hu, as it is written, “My sin is too great to bear.” (The Midrash explains): “Master of the Universe,” said Kayin, “You bear the entire world, but You cannot bear my sin? You wrote, ‘He carries sin and forgives iniquity.’ Forgive my sin, although it is terrible.”
He immediately found favor before HaKadosh Baruch Hu, and half his sentence, na (wander), was lifted, as it is written, “And he dwelt in the Land of Nod.” From here we learn how significant prayer is before HaKadosh Baruch Hu.
The same was true of Chizkiyahu. When the Prophet told him, “Arrange the affairs of your house, for you shall die,” he immediately turned his face toward the wall to pray. HaKadosh Baruch Hu then said to him, “I have heard you prayers, and added fifteen years to your life,” as it is written, “He performs the will of those who fear Him and hears their prayers to rescue them.” 
Every prayer has monumental influence in Heaven and earth, influence that is often too great for our weak minds to grasp or our frail sight to perceive. Yet we must rest assured that each and every prayer will necessarily bear fruit, in one way or another.
Regarding Moshe Rabbeinu’s 515 prayers, it is interesting to note that the world as we know it is destined to exist for a span of 6,000 years, as the Gemara repeatedly states. However, the Midrash gives a more precise of figure of 6,093 years.
Moshe Rabbeinu supplicated Hashem with his 515 prayers, in the final year of his life, which was 2,488 after the world’s creation, and 3,605 years before its completion. The world’s existence is divided into seven-year shemitta cycles. 3,605 divided by 7 equals 515. Therefore, it seems that although Moshe’s prayers were not answered for his own benefit, they were not rejected outright, but reserved instead for the benefit of Bnei Yisrael: one prayer for every seven-year cycle of shemitta. This merit guards us until the end of time and ensures our ultimate return to our Land.
Moshe willingly renounced his heart’s greatest desire for the benefit of his beloved nation, as we find in the following Midrash:
אמר לו הקב"ה משה אין אתה יודע מה לעשות אתה רוצה לאחוז את החבל בשני ראשין אמר לו אם אעברה נא אתה מבקש לקיים בטל סלח נא ואם סלח נא אתה מבקש לקיים בטל אעברה נא. אמר רבי יהושע בן לוי כיון ששמע משה רבינו כך אמר לפניו רבש"ע ימות משה ומאה כיוצא בו ולא תנזק צפורנו של אחד מהם.
HaKadosh Baruch Hu asked Moshe: “Have you not decided which you prefer? Would you grasp the rope from both ends? If you insist on the fulfillment of your prayer, ‘Please let me pass over the Yarden,’ then you must renounce your prayer of, ‘Please forgive them.’ If you insist on the fulfillment of your prayer, ‘Please forgive them,’ then you must renounce your prayer of, ‘Please let me pass over the Yarden.’”
Rebbe Yehoshua ben Levi taught: “When Moshe Rabbeinu heard this ultimatum, he said, ‘Master of the Universe, let Moshe and a hundred like him perish, but do not harm even a fingernail of theirs.’”
Moshe’s 515 prayers were not rejected. They ascended to the heights of the universe, where they still stand on our behalf, like stars in the firmament, shining forth light and blessing for the entire Jewish people until the end of time.
 Devarim 3:23
 Devarim Rabbah 11:10
 See Rambam, Introduction to Pirkei Avos, ch. 7
 Devarim 24:15
 Hosheia 12:1
 Devarim Rabbah 11:10
 Berachos 6b
 Bereishis 4:12
 ibid 4:13
 Micha 7:18
 Bereishis 4:16
 Yeshaya 38
 Tehillim 145:19
 Devarim Rabbah 8
 Rosh Hashana 31a; Avodah Zarah 9a; Sanhedrin 97a
 Midrash Osiyos D’Rebbe Akiva: Batei Midrashos II, p. 356. See Yotzros for Shabbos before Shavuos.
 As stated in Seder Olam, by Rebbe Yossi ben Chalafta
 Devarim Rabbah, Parshas Ki Savo 7:10