Program to check if N is a Hendecagonal Number | Java program for the above approach ; Function to check if N is a hendecagonal number ; Condition to check if the number is a hendecagonal number ; Driver code ; Given number ; Function call
import java . lang . Math ; class GFG { public static boolean ishendecagonal ( int N ) { double n = ( 7 + Math . sqrt ( 72 * N + 49 ) ) / 18 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int N = 11 ; if ( ishendecagonal ( N ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }