Centered tetrahedral number | Function to find centered Centered tetrahedral number ; Formula to calculate nth Centered tetrahedral number and return it into main function . ; Driver Code
function centeredTetrahedralNumber ( n ) { return ( 2 * n + 1 ) * ( n * n + n + 3 ) / 3 ; } var n = 6 ; document . write ( centeredTetrahedralNumber ( n ) ) ;