Ruth - descendant of Bilaam
The gemara in Pesachim (50b) says; ...דאמר רב יהודה אמר רב לעולם יעסוק אדם בתורה ומצות אף על פי שלא לשמה שמתוך שלא לשמה בא לשמה “Rav Yehudah said in the name of Rav, a person should always learn Torah and perform mitzvos even shelo lishmah because by doing this they will come to keep the mitzvos and learn Torah lishmah .” Rb Chaim Volozhin z”l (Pirkei Avos, Ruach Chaim, 1:13) explains that even although the gemara says that it is permissible to perform the mitzvos and learn Torah for ulterior reasons, this is only in a case where a person intends to eventually come to a level where he will perform the mitzvos lishmah . However if a person intends to always keep the Torah and mitzvos shelo lishmah , this is not permitted. The Pachad Yitzchak (Shevuos, 6:4) asks as follows: The source for Rav’s halacha is provided by the gemara in Nazir (23b); אמר רב יהודה אמר רב לעולם יעסוק אדם בתורה ובמצות אפי' שלא לשמן שמתוך שלא לשמן בא לשמן שבשכר מ"ב קרבנות שהקריב בלק הרשע ז...