Check if Pascal 's Triangle is possible with a complete layer by using numbers upto N | Python3 program for the above approach ; Function to check if Pascaltriangle can be made by N integers ; Find X ; If x is integer ; Given number N ; Function call
import math NEW_LINE def checkPascaltriangle ( N ) : NEW_LINE INDENT x = ( math . sqrt ( 8 * N + 1 ) - 1 ) / 2 NEW_LINE if ( math . ceil ( x ) - x == 0 ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT DEDENT N = 10 NEW_LINE checkPascaltriangle ( N ) NEW_LINE