Centered triangular number | function for Centered Triangular number ; formula for find Centered Triangular number nth term ; For 3 rd Centered Triangular number ; For 12 th Centered Triangular number
< ? php function Centered_Triangular_num ( $ n ) { return ( 3 * $ n * $ n + 3 * $ n + 2 ) / 2 ; } $ n = 3 ; echo Centered_Triangular_num ( $ n ) , " STRNEWLINE " ; $ n = 12 ; echo Centered_Triangular_num ( $ n ) , " STRNEWLINE " ; ? >