generator for sequence iteration
solution to problem 10 added