title: Triangular Matchstick Number
signature: triangular_matchstick_number <- function(x) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      abs(actual - expected) < 1e-06
  }
  
  driver <- function(x, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(x), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          6L, 
          63.0
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          25L, 
          975.0
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          15L, 
          360.0
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          30L, 
          1395.0
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          17L, 
          459.0
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          80L, 
          9720.0
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          27L, 
          1134.0
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          13L, 
          273.0
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          12L, 
          234.0
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          67L, 
          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;
  }