Program to check if N is a Centered Pentagonal Number or not | Function to check if number N is a centered pentagonal number ; Condition to check if N is a centered pentagonal number ; Given number ; Function call
function isCenteredpentagonal ( N ) { var n = ( ( 5 + Math . sqrt ( 40 * N - 15 ) ) / 10 ) ; return ( n - parseInt ( n ) == 0 ) ; } var N = 6 ; if ( isCenteredpentagonal ( N ) ) { document . write ( " " ) ; } else { document . write ( " " ) ; }