Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
object Main extends App{
def primes(nums: Stream[Int]): Stream[Int] =
Stream.cons(nums.head, primes(nums.tail filter (_ % nums.head > 0)))
val p = primes(Stream.from(2))
println(p apply 201314)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.