Program to check if N is a Tridecagonal Number or not | Java 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
class GFG { static boolean isTridecagon ( int N ) { float n = ( float ) ( ( 9 + Math . sqrt ( 88 * N + 81 ) ) / 22 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int i = 13 ; if ( isTridecagon ( i ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }