Finding n | A formula based Java program to find sum of series with cubes of first n natural numbers ; Driver Function
function magicOfSequence ( N ) { return ( N * ( N + 1 ) / 2 ) + 2 * N ; } let N = 6 ; document . write ( magicOfSequence ( N ) ) ;