title: Nth Pentagonal Number
signature: nth_pentagonal_number <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      abs(actual - expected) < 1e-06
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          96L, 
          13776.0
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          93L, 
          12927.0
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          15L, 
          330.0
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          8L, 
          92.0
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          21L, 
          651.0
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          14L, 
          287.0
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          11L, 
          176.0
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          79L, 
          9322.0
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          24L, 
          852.0
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          94L, 
          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;
  }