title: Triangular Matchstick Number
signature: function triangularMatchstickNumber($x) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return abs($actual - $expected) < 1e-06;
  }
  
  function driver($x, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($x), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        6, 
        63.0));
      
      printf("TEST-1...%s\n",driver(
        25, 
        975.0));
      
      printf("TEST-2...%s\n",driver(
        15, 
        360.0));
      
      printf("TEST-3...%s\n",driver(
        30, 
        1395.0));
      
      printf("TEST-4...%s\n",driver(
        17, 
        459.0));
      
      printf("TEST-5...%s\n",driver(
        80, 
        9720.0));
      
      printf("TEST-6...%s\n",driver(
        27, 
        1134.0));
      
      printf("TEST-7...%s\n",driver(
        13, 
        273.0));
      
      printf("TEST-8...%s\n",driver(
        12, 
        234.0));
      
      printf("TEST-9...%s\n",driver(
        67, 
        6834.0));
      
  }
  
  main();
  ?>
source_py: def triangular_matchstick_number(x):
      return (((3 * x) * (x + 1)) / 2)
source_cpp: int triangular_matchstick_number(int x) {
    return ( 3 * x * ( x + 1 ) ) / 2;
  }