title: Sum Series 12 32 52 2N 12 1
signature: function sumSeries1232522N121(n: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(84, 790244);
    console.log(`TEST-0...${result}`);
  
    result = driver(74, 540274);
    console.log(`TEST-1...${result}`);
  
    result = driver(91, 1004731);
    console.log(`TEST-2...${result}`);
  
    result = driver(34, 52394);
    console.log(`TEST-3...${result}`);
  
    result = driver(36, 62196);
    console.log(`TEST-4...${result}`);
  
    result = driver(28, 29260);
    console.log(`TEST-5...${result}`);
  
    result = driver(70, 457310);
    console.log(`TEST-6...${result}`);
  
    result = driver(7, 455);
    console.log(`TEST-7...${result}`);
  
    result = driver(24, 18424);
    console.log(`TEST-8...${result}`);
  
    result = driver(47, 138415);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def sum_series_12_32_52_2n_12_1(n):
      return int((((n * ((2 * n) - 1)) * ((2 * n) + 1)) / 3))
source_cpp: int sum_series_12_32_52_2n_12_1(int n) {
    return ( n * ( 2 * n - 1 ) * ( 2 * n + 1 ) ) / 3;
  }