title: Nth Pentagonal Number
signature: function nthPentagonalNumber(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 Math.abs(actual - expected) < 1e-06;
  }
  
  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(96, 13776.0);
    console.log(`TEST-0...${result}`);
  
    result = driver(93, 12927.0);
    console.log(`TEST-1...${result}`);
  
    result = driver(15, 330.0);
    console.log(`TEST-2...${result}`);
  
    result = driver(8, 92.0);
    console.log(`TEST-3...${result}`);
  
    result = driver(21, 651.0);
    console.log(`TEST-4...${result}`);
  
    result = driver(14, 287.0);
    console.log(`TEST-5...${result}`);
  
    result = driver(11, 176.0);
    console.log(`TEST-6...${result}`);
  
    result = driver(79, 9322.0);
    console.log(`TEST-7...${result}`);
  
    result = driver(24, 852.0);
    console.log(`TEST-8...${result}`);
  
    result = driver(94, 13207.0);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def nth_pentagonal_number(n):
      return ((((3 * n) * n) - n) / 2)
source_cpp: int nth_pentagonal_number(int n) {
    return ( 3 * n * n - n ) / 2;
  }