Centered tetrahedral number | C # Program to find nth 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
using System ; class GFG { static int centeredTetrahedralNumber ( int n ) { return ( 2 * n + 1 ) * ( n * n + n + 3 ) / 3 ; } public static void Main ( ) { int n = 6 ; Console . WriteLine ( centeredTetrahedralNumber ( n ) ) ; } }