Finding n | A formula based Python program to find sum of series with cubes of first n natural numbers ; Driver Function
def magicOfSequence ( N ) : NEW_LINE INDENT return ( N * ( N + 1 ) / 2 ) + 2 * N NEW_LINE DEDENT N = 6 NEW_LINE print ( int ( magicOfSequence ( N ) ) ) NEW_LINE