A fairly simple problem in Scheme, which is a functional language that we had a couple of weeks to learn.