Bechoros2: 4
הַמְקַבֵּל צֹאן בַּרְזֶל מִן הַנָּכְרִי, וְלָדוֹת פְּטוּרִין, וּוַלְדֵי וְלָדוֹת חַיָּבִין. הֶעֱמִיד וְלָדוֹת תַּחַת אִמּוֹתֵיהֶם, וַלְדֵי וְלָדוֹת פְּטוּרִין, וּוַלְדֵי וַלְדֵי וְלָדוֹת חַיָּבִין. רַבָּן שִׁמְעוֹן בֶּן גַּמְלִיאֵל אוֹמֵר: אֲפִלּוּ עַד עֲשָׂרָה דוֹרוֹת פְּטוּרִין, שֶׁאַחֲרָיוּתָן לַנָּכְרִי.
[If] one receives animals at their fixed value from a non-Jew, the offspring are exempt [from the law of bechor], but the offspring of that offspring are liable. [If] he put the offspring in place of their mothers, the offspring of the offspring are exempt [from the law of bechor], but the offspring of the offspring of that offspring are subject [to it]. Rabban Shimon ben Gamliel says: Even up to ten generations, they are exempt [from the law of bechor], because the non-Jew has a lien on them.