title: Hexagonal Number
signature: hexagonal_number <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          38L, 
          2850L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          44L, 
          3828L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          58L, 
          6670L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          10L, 
          190L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          31L, 
          1891L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          53L, 
          5565L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          94L, 
          17578L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          64L, 
          8128L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          71L, 
          10011L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          59L, 
          6903L
      )))
  
  }
  
  main()
source_py: def hexagonal_number(n):
      return (n * ((2 * n) - 1))
source_cpp: int hexagonal_number(int n) {
    return n * ( 2 * n - 1 );
  }