Program to check if N is a triacontagonal number | Java program to check whether a number is an triacontagonal number or not ; Function to check whether a number is an triacontagonal number or not ; Condition to check whether a number is an triacontagonal number or not ; Driver code ; Given number ; Function call
class GFG { static boolean istriacontagonal ( int N ) { float n = ( float ) ( ( 26 + Math . sqrt ( 224 * N + 676 ) ) / 56 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 30 ; if ( istriacontagonal ( N ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }