That an exercise on SICP, a Scheme learning book. And there are similar ones for Common Lisp.
http://xuanji.appspot.com/isicp/
Enjoy.
If you want something offline, I can help you to set Chicken (the interpreter), the depending libraries for SICP and Emacs in no time.