Program to check if N is a Tridecagonal Number or not | Python3 implementation to check that a number is a tridecagon number or not ; Function to check that the number is a tridecagon number ; Condition to check if the number is a tridecagon number ; Driver Code ; Function call
import math NEW_LINE def isTridecagon ( N ) : NEW_LINE INDENT n = ( 9 + math . sqrt ( 88 * N + 81 ) ) / 22 NEW_LINE return ( n - int ( n ) ) == 0 NEW_LINE DEDENT i = 13 NEW_LINE if ( isTridecagon ( i ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT