Program to check if N is a Centered heptagonal number | Python3 implementation to check that a number is a centered heptagonal number or not ; Function to check that the number is a centered heptagonal number ; Condition to check if the number is a centered heptagonal number ; Driver Code ; Function call
import math NEW_LINE def isCenteredheptagonal ( N ) : NEW_LINE INDENT n = ( 7 + math . sqrt ( 56 * N - 7 ) ) / 14 NEW_LINE return ( n - int ( n ) ) == 0 NEW_LINE DEDENT n = 8 NEW_LINE if ( isCenteredheptagonal ( n ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT