Find a range of composite numbers of given length | function to calculate factorial ; to print range of length n having all composite integers ; driver code to test above functions
def factorial ( n ) : NEW_LINE INDENT a = 1 NEW_LINE for i in range ( 2 , n + 1 ) : NEW_LINE INDENT a *= i NEW_LINE DEDENT return a NEW_LINE DEDENT def printRange ( n ) : NEW_LINE INDENT a = factorial ( n + 2 ) + 2 NEW_LINE b = a + n - 1 NEW_LINE print ( " [ " + str ( a ) + " , ▁ " + str ( b ) + " ] " ) NEW_LINE DEDENT n = 3 NEW_LINE printRange ( n ) NEW_LINE