 puts "The largest Fibonacci number under 1,000,000:"
 puts fibonacci.take_while((n) ->  n < 1000000).last()
 puts()
+
+test   = (p) -> (n) -> n % p != 0
+sieve  = (s) -> new Stream(s.first, -> sieve(s.rest().select(test(s.first))))
+primes = sieve(Stream.from(2))
+
+puts "The prime numbers between 10000 and 10100:"
+puts primes.drop_while((n) ->  n < 10000).take_while((n) ->  n < 10100)
+puts()

puts fibonacci.take(100)
puts()

puts "The Fibonacci numbers between and 1000 and 100000:"
puts fibonacci.drop_while((n) ->  n < 1000).take_while((n) ->  n < 100000)
puts()


      val
  }
  -> cache.force()


class Stream
  constructor: (@first, rest) ->
