Program to check if N is a Octadecagon number | Python3 program for the above approach ; Function to check if N is a octadecagon number ; Condition to check if the number is a octadecagon number ; Driver code ; Given number ; Function Call
import math NEW_LINE def isOctadecagon ( N ) : NEW_LINE INDENT n = ( 14 + math . sqrt ( 128 * N + 196 ) ) // 32 NEW_LINE return ( ( n - int ( n ) ) == 0 ) NEW_LINE DEDENT if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT N = 18 NEW_LINE if isOctadecagon ( N ) : NEW_LINE INDENT print ( ' Yes ' ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' No ' ) NEW_LINE DEDENT DEDENT