old_contents: from itertools import imap
  import sys
  
  
  def square(x):
      return x ** 2
  
  
  def sum_of_squares(numbers):
      return sum(imap(square, numbers))
  
  
  def square_of_sums(numbers):
      return square(sum(numbers))
  
  
  def main(x):
      seq = xrange(1, x + 1)
      return square_of_sums(seq) - sum_of_squares(seq)
  
  
  if __name__ == '__main__':
      try:
          x = int(sys.argv[1])
      except (IndexError, ValueError):
          x = 100
      print main(x)
  
new_contents: import sys
  
  
  def sum_of_squares(n):
      return n * (n + 1) * (2 * n + 1) / 6
  
  
  def square_of_sums(n):
      return (x * (x + 1) / 2) ** 2
  
  
  def main(x):
      return square_of_sums(x) - sum_of_squares(x)
  
  
  if __name__ == '__main__':
      try:
          x = int(sys.argv[1])
      except (IndexError, ValueError):
          x = 100
      print main(x)
  
subject: improve #6