Skip to content

Instantly share code, notes, and snippets.

@bigeagle
Created January 5, 2013 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigeagle/4461220 to your computer and use it in GitHub Desktop.
Save bigeagle/4461220 to your computer and use it in GitHub Desktop.
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