title: Number Triangles N Moves
signature: function number_triangles_n_moves(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(33, 11118121133111045);
      @printf("TEST-0...%s\n",result);
      
      result = driver(8, 13121);
      @printf("TEST-1...%s\n",result);
      
      result = driver(6, 1457);
      @printf("TEST-2...%s\n",result);
      
  end
  
  main()
source_py: def number_triangles_n_moves(n):
      answer = ([None] * (n + 1))
      answer[0] = 1
      i = 1
      while (i <= n):
          answer[i] = ((answer[(i - 1)] * 3) + 2)
          i = (i + 1)
      return answer[n]
source_cpp: int number_triangles_n_moves(int n) {
    int answer [ n + 1 ] = {
      0 };
      answer [ 0 ] = 1;
      for ( int i = 1;
      i <= n;
      i ++ ) answer [ i ] = answer [ i - 1 ] * 3 + 2;
      return answer [ n ];
    }