Sum of squares of first n natural numbers | Return the sum of square of first n natural numbers ; Driver Code
< ? php function squaresum ( $ n ) { return ( $ n * ( $ n + 1 ) / 2 ) * ( 2 * $ n + 1 ) / 3 ; } $ n = 4 ; echo squaresum ( $ n ) ; ? >