Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Numbers Factory solution in Clear category for Numbers Factory by IRONKAGE
def checkio(number):
positive = ''
for prime in range(9, 1, -1):
while number % prime == 0:
number /= prime
positive += str(prime)
return int(positive [:: - 1]) if number == 1 else 0
if __name__ == '__main__':
assert checkio(20) == 45, "1st example"
assert checkio(21) == 37, "2nd example"
assert checkio(17) == 0, "3rd example"
assert checkio(33) == 0, "4th example"
assert checkio(3125) == 55555, "5th example"
assert checkio(9973) == 0, "6th example"
Sept. 14, 2019