Exercise 6.8: Implemented sequence and intsViaSequence.