Program to check if N is a Centered Decagonal Number | Java implementation to check that a number is a centered decagonal number or not ; Function to check that the number is a centered decagonal number ; Condition to check if the number is a centered decagonal number ; Driver Code ; Function call
import java . lang . Math ; class GFG { public static boolean isCentereddecagonal ( int N ) { double n = ( 5 + Math . sqrt ( 20 * N + 5 ) ) / 10 ; return ( n - ( int ) n ) == 0 ; } public static void main ( String [ ] args ) { int n = 11 ; if ( isCentereddecagonal ( n ) ) { System . out . println ( " Yes " ) ; } else { System . out . println ( " No " ) ; } } }