title: Sum from 1 to n, 2 to n, ... n in python
body: <p>I was trying to get a series of sum from 1 to n, 2 to n, ..., and n</p>
  
  <p>For example, if n=5, then the result should be
  15
  14
  12
  9
  5</p>
  
  <p>Please comment for the code below. I can't figure out what's wrong.</p>
  
  <pre><code>n=int(input())
  sum=0
  m=0
  factorial=1
  
  for i in range(1, n + 1):
      factorial *= i
      sum=factorial-m
      print(sum)
  </code></pre>