title: How to select values within a provided index range from a List using LINQ
body: <p>I am a LINQ newbie trying to use it to acheive the following:</p>
  
  <p>I have a list of ints:-</p>
  
  <pre><code>List&lt;int&gt; intList = new List&lt;int&gt;(new int[]{1,2,3,3,2,1});
  </code></pre>
  
  <p>Now, I want to compare the sum of the first three elements [index range 0-2] with the last three [index range 3-5] using LINQ. I tried the LINQ Select and Take extension methods as well as the SelectMany method, but I cannot figure out how to say something like </p>
  
  <pre><code>(from p in intList  
  where p in  Take contiguous elements of intList from index x to x+n  
  select p).sum()
  </code></pre>
  
  <p>I looked at the Contains extension method too, but that doesn't see to get me what I want. Any suggestions? Thanks.</p>