title: Big O, what is the complexity of summing a series of n numbers?
body: <p>I always thought the complexity of:</p>
  
  <p><code>1 + 2 + 3 + ... + n</code> is O(n), and summing two n by n matrices would be O(n^2).</p>
  
  <p>But today I read from a textbook, "by the formula for the sum of the first n integers, this is n(n+1)/2" and then thus: (1/2)n^2 + (1/2)n, and thus O(n^2).</p>
  
  <p>What am I missing here? </p>