Centered decagonal number | Centered decagonal number function ; Formula to calculate nth centered decagonal number & return it into main function . ; Driver Code
function centereddecagonalnum ( n ) { return ( 5 * n * n + 5 * n + 1 ) ; } var n = 5 ; document . write ( n + " " + " " ) ; document . write ( centereddecagonalnum ( n ) + " " ) ; n = 9 ; document . write ( n + " " + " " ) ; document . write ( centereddecagonalnum ( n ) ) ;