title: Program Print Sum Given Nth Term
signature: program_print_sum_given_nth_term <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          39L, 
          1521L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          20L, 
          400L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          10L, 
          100L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          39L, 
          1521L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          70L, 
          4900L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          21L, 
          441L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          21L, 
          441L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          80L, 
          6400L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          89L, 
          7921L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          99L, 
          9801L
      )))
  
  }
  
  main()
source_py: def program_print_sum_given_nth_term(n):
      S = 0
      for i in range(1, (n + 1)):
          S += ((i * i) - ((i - 1) * (i - 1)))
      return S
source_cpp: int program_print_sum_given_nth_term(long n) {
    int S = 0;
    for ( int i = 1;
    i <= n;
    i ++ ) S += i * i - ( i - 1 ) * ( i - 1 );
    return S;
  }