Hexadecagonal number | Function to calculate hexadecagonal number ; Driver code
function hexadecagonalNum ( n ) { return ( ( 14 * n * n ) - 12 * n ) / 2 ; } var n = 5 ; document . write ( n + " " + " " + hexadecagonalNum ( n ) + " " ) ; n = 9 ; document . write ( n + " " + " " + hexadecagonalNum ( n ) ) ;