title: Java 8 Lambda expressions for solving fibonacci (non recursive way)
body: <p>I am a beginner in using Lambda expression feature in Java 8. Lambda expressions are pretty well useful in solving programs like Prime number check, factorial etc.</p>
  
  <p>However can they be utilized effectively in solving problems like Fibonacci where the current value depends on sum of previous two values. I have pretty well solved prime number check problem effectively using Lambda expressions. The code for the same is given below.</p>
  
  <pre><code>boolean checkPrime=n&gt;1 &amp;&amp; LongStream.range(2, (long) Math.sqrt(n)).parallel().noneMatch(e-&gt;(n)%e==0);
  </code></pre>
  
  <p>In the above code in the <code>noneMatch</code> method we are evaluating with the current value(<code>e</code>) in the range. But for the Fibonacci problem, we requires previous two values. </p>
  
  <p>How can we make it happen?</p>