Program to find the Nth term of the series 0 , 14 , 40 , 78 , 124 , ... | calculate sum upto Nth term of series ; return the final sum ; Driver code
< ? php function nthTerm ( $ n ) { return 6 * pow ( $ n , 2 ) - 4 * $ n - 2 ; } $ N = 4 ; echo nthTerm ( $ N ) ;