Finding n | A formula based PHP program to find sum of series with cubes of first n natural numbers ; Driver Code
< ? php function magicOfSequence ( $ N ) { return ( $ N * ( $ N + 1 ) / 2 ) + 2 * $ N ; } $ N = 6 ; echo magicOfSequence ( $ N ) . " STRNEWLINE " ; ? >