Program to check if N is a Star Number | Python3 implementation to check that a number is a star number or not ; Function to check that the number is a star number ; Condition to check if the number is a star number ; Driver Code ; Function call
import math NEW_LINE def isStar ( N ) : NEW_LINE INDENT n = ( math . sqrt ( 24 * N + 12 ) + 6 ) / 6 NEW_LINE return ( n - int ( n ) ) == 0 NEW_LINE DEDENT i = 13 NEW_LINE if isStar ( i ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT