Deuteronomy 14:23
14:23 In the presence of the Lord your God you must eat from the tithe of your grain, your new wine, your olive oil, and the firstborn of your herds and flocks in the place he chooses to locate his name, so that you may learn to revere the Lord your God always.
Deuteronomy 21:17
21:17 Rather, he must acknowledge the son of the less loved wife as firstborn and give him the double portion of all he has, for that son is the beginning of his father’s procreative power – to him should go the right of the firstborn.