Sum of square | Function to find sum of sum of square of first n natural number ; Driver Code
< ? php function findSum ( $ n ) { $ sum = 0 ; for ( $ i = 1 ; $ i <= $ n ; $ i ++ ) $ sum += ( ( $ i * ( $ i + 1 ) * ( 2 * $ i + 1 ) ) / 6 ) ; return $ sum ; } $ n = 3 ; echo findSum ( $ n ) ; ? >