Program to check if N is a Centered nonadecagonal number | Java implementation to check that a number is a Centered nonadecagonal number or not ; Function to check that the number is a Centered nonadecagonal number ; Condition to check if the number is a Centered nonadecagonal number ; Driver Code ; Function call
class GFG { static boolean isCenterednonadecagonal ( int N ) { float n = ( float ) ( ( 19 + Math . sqrt ( 152 * N + 209 ) ) / 38 ) ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int n = 20 ; if ( isCenterednonadecagonal ( n ) ) { System . out . print ( " Yes " ) ; } else { System . out . print ( " No " ) ; } } }