Check if Pascal 's Triangle is possible with a complete layer by using numbers upto N | Function to check if Pascaltriangle can be made by N integers ; Find X ; If x is integer ; Given number N ; Function Call
function checkPascaltriangle ( N ) { var x = ( Math . sqrt ( 8 * N + 1 ) - 1 ) / 2 ; if ( Math . ceil ( x ) - x == 0 ) document . write ( " " ) ; else document . write ( " " ) ; } var N = 10 ; checkPascaltriangle ( N ) ;