Program to check if N is a Heptagonal Number | Function to check if N is a Heptagonal number ; Condition to check if the number is a heptagonal number ; Given Number ; Function call
function isheptagonal ( N ) { var n = ( 3 + Math . sqrt ( 40 * N + 9 ) ) / 10 ; return ( n - parseInt ( n ) ) == 0 ; } var N = 7 ; if ( isheptagonal ( N ) ) { document . write ( " " ) ; } else { document . write ( " " ) ; }