Computing Fermat Numbers

A procedure to compute the nth Fermat number.
   (define fermat-number     ; computes the nth
     (lambda (n)             ; Fermat number
       (+ (repeatedly-square 2 n) 1)))
where (repeatedly-square b n) returns the result of squaring b n times.