text: Number of coloured 0 's in an N | Function to return the count of coloured 0 s in an n - level hexagon ; Driver code
code: function count ( n ) { return parseInt ( n * ( 3 * n - 1 ) / 2 ) ; } var n = 3 ; document . write ( count ( n ) ) ;