Sum of the series 1 + ( 1 + 3 ) + ( 1 + 3 + 5 ) + ( 1 + 3 + 5 + 7 ) + Ã ¢ â ‚¬¦ Ã ¢ â ‚¬¦ + ( 1 + 3 + 5 + 7 + Ã ¢ â ‚¬¦ + ( 2 n | functionn to find the sum of the given series ; required sum ; Driver Code
< ? php function sumOfTheSeries ( $ n ) { return ( $ n * ( $ n + 1 ) / 2 ) * ( 2 * $ n + 1 ) / 3 ; } $ n = 5 ; echo " Sum ▁ = ▁ " . sumOfTheSeries ( $ n ) ; ? >