Program to check if N is a Centered Decagonal Number | Python3 program for the above approach ; Function to check if the number N is a centered decagonal number ; Condition to check if N is centered decagonal number ; Driver Code ; Function call
import numpy as np NEW_LINE def isCentereddecagonal ( N ) : NEW_LINE INDENT n = ( 5 + np . sqrt ( 20 * N + 5 ) ) / 10 NEW_LINE return ( n - int ( n ) ) == 0 NEW_LINE DEDENT N = 11 NEW_LINE if ( isCentereddecagonal ( N ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT