Heptagonal number | Function to find nth Heptagonal number ; Driver Code
def heptagonalNumber ( n ) : NEW_LINE INDENT return ( ( 5 * n * n ) - ( 3 * n ) ) // 2 NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT n = 2 NEW_LINE print ( heptagonalNumber ( n ) ) NEW_LINE n = 15 NEW_LINE print ( heptagonalNumber ( n ) ) NEW_LINE DEDENT