Centered pentagonal number | Function to calculate Centered pentagonal number . ; Formula to calculate nth Centered pentagonal number . ; Driver Code
def centered_pentagonal_Num ( n ) : NEW_LINE INDENT return ( 5 * n * n - 5 * n + 2 ) // 2 NEW_LINE DEDENT n = 7 NEW_LINE print ( " % sth ▁ Centered ▁ pentagonal ▁ number ▁ : ▁ " % n , centered_pentagonal_Num ( n ) ) NEW_LINE