Whenever I teach OT, I like to emphasize that genealogies have a purpose--they virtually always have some deep significance. The generations of Adam in Genesis 4 and 5 are a good case in point. From Adam emerges two lines of descent--a wicked line through Cain and a righteous line through Seth. Read Genesis 4 and 5 carefully and you'll discover that the full flowering of wickedness or righteousness becomes apparent in the seventh generation from Adam in each respective line. One might make a few observations.
Through Cain's line, the name of his son--a family name--is promiment (Gen. 4:17). This line is associated with building cities (civilization) and learning music (leisure) (cf. Gen. 4:21-22). In the seventh generation from Adam in Cain's line emerges Lamech, a vengeful murderer (Gen 4:19-24.
However, in the seventh generation from Adam in Seth's line emerges Enoch, who "walked with God... and God took him" (Gen 5:21-24). This line is associated with men who call on the name of the Lord (Gen 4:26). In contrast to the Cainites, the Sethites are linked with those who are described as living the life of toil--bearing one of the curses of Adam and Eve's sin (Gen. 3:17; Gen 4:29).
Now, whenever I explain all this I always have to point out that Genesis never explicit mentions the significance of the seventh generation--it is only evident after a close literary analysis.
However, as I was covering Jude this week in my Into to NT class, I noticed something interesting in Jude 14: "It was of these also that Enoch in the seventh generation from Adam prophesied..." Seems that Jude was counting the generations as well...