title: Nth Pentagonal Number
signature: function nthPentagonalNumber($n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return abs($actual - $expected) < 1e-06;
  }
  
  function driver($n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        96, 
        13776.0));
      
      printf("TEST-1...%s\n",driver(
        93, 
        12927.0));
      
      printf("TEST-2...%s\n",driver(
        15, 
        330.0));
      
      printf("TEST-3...%s\n",driver(
        8, 
        92.0));
      
      printf("TEST-4...%s\n",driver(
        21, 
        651.0));
      
      printf("TEST-5...%s\n",driver(
        14, 
        287.0));
      
      printf("TEST-6...%s\n",driver(
        11, 
        176.0));
      
      printf("TEST-7...%s\n",driver(
        79, 
        9322.0));
      
      printf("TEST-8...%s\n",driver(
        24, 
        852.0));
      
      printf("TEST-9...%s\n",driver(
        94, 
        13207.0));
      
  }
  
  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;
  }