Sum of the first N Pronic Numbers | Function to calculate the sum ; Driver code
def calculateSum ( N ) : NEW_LINE INDENT return ( N * ( N - 1 ) // 2 + N * ( N - 1 ) * ( 2 * N - 1 ) // 6 ) ; NEW_LINE DEDENT N = 3 ; NEW_LINE print ( calculateSum ( N ) ) ; NEW_LINE