Num Numbers, chapter Book of Numbers, chapter 18
The firstborn males, both humans and domestic animals, that are offered to me, will be yours. But people must buy back their firstborn sons and the firstborn animals that may not be used for sacrifices. Exo 34:19