title: Sum K Th Group Odd Positive Numbers
signature: function sumKThGroupOddPositiveNumbers($k) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($k, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($k), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        91, 
        753571));
      
      printf("TEST-1...%s\n",driver(
        52, 
        140608));
      
      printf("TEST-2...%s\n",driver(
        78, 
        474552));
      
      printf("TEST-3...%s\n",driver(
        51, 
        132651));
      
      printf("TEST-4...%s\n",driver(
        65, 
        274625));
      
      printf("TEST-5...%s\n",driver(
        39, 
        59319));
      
      printf("TEST-6...%s\n",driver(
        42, 
        74088));
      
      printf("TEST-7...%s\n",driver(
        12, 
        1728));
      
      printf("TEST-8...%s\n",driver(
        56, 
        175616));
      
      printf("TEST-9...%s\n",driver(
        98, 
        941192));
      
  }
  
  main();
  ?>
source_py: def sum_k_th_group_odd_positive_numbers(k):
      cur = int(((k * (k - 1)) + 1))
      sum = 0
      while k:
          sum += cur
          cur += 2
          k = (k - 1)
      return sum
source_cpp: int sum_k_th_group_odd_positive_numbers(int k) {
    int cur = ( k * ( k - 1 ) ) + 1;
    int sum = 0;
    while ( k -- ) {
      sum += cur;
      cur += 2;
    }
    return sum;
  }