דור לאלף צוה דבר בריתו לעולם זכרו
Rashi explains the meaning of the passuk "davar tzivah l’elef dor":
Initially, Hashem created the Torah in order to give it over in the form of the commandments one thousand generations after the creation of the world. But because He saw that it is impossible for the world to exist for so long without Torah, instead of creating the world and the Torah at the same time, He first created the Torah, and delayed the creation of the world for 974 generations (as explained in Chaggigah 13b and in Zevachim 116a), and from the fact that Moshe received it twenty six generations after the creation of the world, we find that Hashem’s Will was fulfilled and 1,000 generations passed from the creation of the Torah until it was commanded to Am Yisrael (Rashi Chaggigah 14a, ad loc. Kodem, and Zevachim ibid ad loc. Teisha, based on Turei Even, Chaggigah 13b).
The Rokeach (Peirushei Siddur Hatefillah, Vol. I, p. 50) added that the words "לאלף דר" are numerically equivalent to משה, to teach us that a thousand generations after its creation, Moshe Rabbeinu received the Torah [see Ma’amarei HaRema MiPano (Ma’amer Me’ayan Ganim Vol. I) which explain that although the word דור is written in the whole Torah with the vav, still, it can be explained with a gematria as if it is written דר without the vav.]
The Chasam Sofer (Shabbos 105a) gave an allusion to this concept from the fact that the first of the Aseres Hadibros – "Anochi Hashem" begins with the letter aleph: the letter א is written out אלף, like the number elef, 1000, an allusion to the 1000 generations that passed form the creation of the Torah until it has given. Likewise, the form of the letter aleph is comprised of two yuden and one slanted vav, which together are numerically equivalent to 26, alluding to the twenty-six generations from the creation of the world until Kabbalas HaTorah.
Zeh Le’umas Zeh
דור לאלף צוה דבר בריתו לעולם זכרו
This passuk is written twice in the Torah, with a minor change. In Divrei Hayamim (I, 16:15) the passuk makes the remembrance contingent on Am Yisrael, saying "zichru l’olam briso," and as we say in the seder hatefillah, in Tehillim (105:8) the passuk pins the zechirah on Hashem: "Zachar l’olam briso."
The Lechem Rav (395) explains that the two zechiros are contingent on one another; "zichru l’olam briso" – remember the Torah that was given to you as a bris, a covenant, and through the emunah in its eternality, they fulfilled its dictates forever – "l’elef dor," and thus HaKadosh Baruch Hu will remember His bris with them for eternity – "l’elef dor."
