title: Nth Pentagonal Number
signature: fun nthPentagonalNumber(n: Int): Float {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Float, expected:Float):Boolean{
    return abs(actual - expected) < 1e-06f
  }
  fun driver(n: Int, expected:Float):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(96, 13776.0f)
      println("TEST-0...${result}")
      
      result = driver(93, 12927.0f)
      println("TEST-1...${result}")
      
      result = driver(15, 330.0f)
      println("TEST-2...${result}")
      
      result = driver(8, 92.0f)
      println("TEST-3...${result}")
      
      result = driver(21, 651.0f)
      println("TEST-4...${result}")
      
      result = driver(14, 287.0f)
      println("TEST-5...${result}")
      
      result = driver(11, 176.0f)
      println("TEST-6...${result}")
      
      result = driver(79, 9322.0f)
      println("TEST-7...${result}")
      
      result = driver(24, 852.0f)
      println("TEST-8...${result}")
      
      result = driver(94, 13207.0f)
      println("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;
  }