Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-intermediate-reader.ss" "lang")((modname |23.2|) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp") (lib "arrow.ss" "teachpack" "htdp") (lib "gui.ss" "teachpack" "htdp")))))
4 ;a-fives : N[>=0] -> number
5 ;Given n, determine recursively the value of the n-th term in the series 8, 13, 18, etc. where the first term has an index 0.
7 (define (a-fives n)
8 (cond
9 [(zero? n) 8]
10 [else (+ 5 (a-fives (sub1 n)))]))
12 ;a-fives-closed : N[>=0] -> number