Sum of first n odd numbers in O ( 1 ) Complexity | Returns the sum of first n odd numbers ; Driver Code
< ? php function oddSum ( $ n ) { return ( $ n * $ n ) ; } $ n = 20 ; echo " ▁ Sum ▁ of ▁ first ▁ " , $ n , " ▁ Odd ▁ Numbers ▁ is : ▁ " , oddSum ( $ n ) ; ? >