Dodecahedral number | Function to find dodecahedral number ; Formula to calculate nth dodecahedral number and return it into main function . ; Driver code ; print result
function dodecahedral_num ( n ) { return n * ( 3 * n - 1 ) * ( 3 * n - 2 ) / 2 ; } var n = 5 ; document . write ( n + " " + " " ) ; document . write ( dodecahedral_num ( n ) ) ;