Implementation of problem 22, using both recursive and sequence-library approach