Sum of series 1 ^ 2 + 3 ^ 2 + 5 ^ 2 + . . . + ( 2 * n | Function to find sum of series . ; Driver code
< ? php function sumOfSeries ( $ n ) { $ sum = 0 ; for ( $ i = 1 ; $ i <= $ n ; $ i ++ ) $ sum = $ sum + ( 2 * $ i - 1 ) * ( 2 * $ i - 1 ) ; return $ sum ; } $ n = 10 ; echo ( sumOfSeries ( $ n ) ) ; ? >