title: Matrix power sum
body: <p>What is the best way to calculate sum of matrices such as A^i + A^(i+1) + A^i+2........A^n for very large n?</p>
  
  <p>I have thought of <strong>two possible ways:</strong></p>
  
  <p>1) Use logarithmic matrix exponentiation(LME) for A^i, then calculate the subsequent matrices by multiplying by A.</p>
  
  <p><strong>Problem</strong>: Doesn't really take advantage of the LME algorithm as i am using it only for the lowest power!!</p>
  
  <p>2)Use LME for finding A^n and memoize the intermediate calculations.</p>
  
  <p><strong>Problem:</strong> Too much space required for large n.</p>
  
  <p><strong>Is there a third way?</strong>   </p>