Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Numbers Factory - brute force solution solution in Clear category for Numbers Factory by darasg2008
def checkio(number):
#checking if possible
i=2
num=number
while number>1 and i<10:
while number%i==0:
number=number//i
i+=1
if number!=1:
return 0
def productofdigits(n):
q=1
while n>1:
p=n%10
if p!=0:
q=q*p
n=n//10
return q
#brute force
for n in range(99999):
product=productofdigits(n)
if product==num:
return n
Nov. 6, 2016