title: Scala Range(x, Int.MaxValue) vs. Stream.from(x)
body: <p>I am a Scala beginner, practicing my FP skills with <a href="http://projecteuler.net/">Project Euler</a>.</p>
  
  <p>While working on <em>"<a href="http://projecteuler.net/problem=5">Problem 5:</a> What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20"</em>, I was comparing Range- vs. Stream-based solutions:</p>
  
  <pre><code>val r1 = Range(20, Int.MaxValue).find(i =&gt; (2 to 20).forall(i % _ == 0)).get
  val r2 = Stream.from(20).find(i =&gt; (2 to 20).forall(i % _ == 0)).get
  </code></pre>
  
  <p>Strangely, the computation of r1 finishes in roughly 20 seconds, while the Stream-based calculation of r2 is running out of memory. I would have expected the opposite -- could anyone explain please?</p>