Centered Square Number | Function to calculate Centered square number function ; Formula to calculate nth Centered square number ; Driver Code
def centered_square_num ( n ) : NEW_LINE INDENT return n * n + ( ( n - 1 ) * ( n - 1 ) ) NEW_LINE DEDENT n = 7 NEW_LINE print ( " % sth ▁ Centered ▁ square ▁ number : ▁ " % n , centered_square_num ( n ) ) NEW_LINE