Deuteronomy 21:17

But he shall acknowledge the son of the unloved wife as the firstborn by giving him a double portion of all that he has, for he is the beginning of his strength; the right of the firstborn is his.