Solve problem 1 in Scheme