Calculate occurrence of an element in factorial of a number
def legendre ( factor , num ) : NEW_LINE INDENT count = 0 NEW_LINE fac2 = factor ; NEW_LINE while ( num >= factor ) : NEW_LINE INDENT count += num // factor ; NEW_LINE factor *= fac2 ; NEW_LINE DEDENT return count ; NEW_LINE DEDENT def possible ( factors , num ) : NEW_LINE