Bechoros chapter two, mishnah five. The mishnah deals with a firstborn offspring that does not resemble the species of its mother, and the question of whether the laws of a firstborn apply to it.
"Rachel she'yaldah kemin ez, v'ez she'yaldah kemin rachel - patur min habechorah" - a ewe that gave birth to an offspring resembling a goat, and a goat that gave birth to an offspring resembling a ewe, is exempt from firstborn status:
"Rachel she'yaldah kemin ez" - a female sheep that gave birth to a male offspring, and it is her firstborn, except that the offspring looks exactly like a goat and bears no resemblance at all to a sheep.
"V'ez she'yaldah kemin rachel" - a goat that gave birth to a male offspring for the first time, and the offspring looks exactly like a sheep, with no resemblance at all to a goat.
In both of these cases, the mishnah rules: "Patur min habechorah" - the offspring is completely exempt from the laws of the firstborn.
The source for this law in the verse:
It is stated: "Only the firstborn of an ox, or the firstborn of a sheep, or the firstborn of a goat." The repetition of the word "firstborn" for each individual species teaches that the firstborn of an ox must look like an ox, the firstborn of a goat like a goat, and the firstborn of a sheep like a sheep. Therefore, when the offspring bears no resemblance at all to the species of its parents, it is exempt from the laws of the firstborn.
"V'im yesh bo miktzas simanim - chayav" - and if it has some characteristics, it is obligated:
If the offspring has any resemblance to the species of its parent, it is subject to the laws of the firstborn and is considered a firstborn. Even a slight resemblance is enough to obligate it.
An offspring that completely resembles another species is called a "nidmeh". The rule that emerges from the mishnah is: If the offspring bears no resemblance at all to the species of its parents - it is completely exempt; and if it has any resemblance - it is a firstborn and is obligated.
Why the mishnah specifically mentions a ewe and a goat:
The mishnah chose the examples of a sheep and a goat because both of these species are subject to the laws of the firstborn. The novelty is that even though both - the parent and the offspring - appear as a species obligated in firstborn laws, it is nevertheless exempt. All the more so, if the mother is obligated in firstborn laws and the offspring looks like a completely different species that is not of the flock at all, it is exempt from being a firstborn.
The law of an offspring that has some characteristics:
Even though this offspring, which has only a slight resemblance to its parents' species, is subject to the laws of a firstborn - it is considered blemished, for there is no greater blemish than an offspring not looking like its own species. Therefore, the halachah is: A goat or a sheep that gives birth to an offspring that only slightly resembles its species - the offspring is given to the kohen, and the kohen is permitted to eat it immediately as a blemished animal.
In summary: In this Mishnah we learned that an offspring that has no resemblance at all to its parents' species is exempt from the laws of the firstborn, as derived from the amplification in the verse, "But the firstborn of an ox, or the firstborn of a sheep, or the firstborn of a goat"; whereas an offspring that has some of the characteristics is obligated in the laws of the firstborn, except that it is considered a blemished animal and may be eaten by the kohen immediately.