Find Nth term of the series 0 , 2 , 4 , 8 , 12 , 18. . . | Calculate Nth term of series ; Driver Code
< ? php function nthTerm ( $ N ) { return ( int ) ( ( $ N + $ N * ( $ N - 1 ) ) / 2 ) ; } $ N = 5 ; echo nthTerm ( $ N ) ; ? >