Advertisement
Guest User

Odd Limit

a guest
Jul 7th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Racket 0.36 KB | None | 0 0
  1. (define (bounce-series x)
  2.   (local [(define (b-s x acc)
  3.             (cond [(= acc 100) x]
  4.                   [(even? acc) (b-s (series1 x) (add1 acc))]
  5.                   [(odd? acc) (b-s (series2 x) (add1 acc))]))
  6.          
  7.           (define (series1 x)
  8.             (/ 1 x))
  9.          
  10.           (define (series2 x)
  11.             (add1 x))]
  12.    
  13.     [b-s x 0]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement