def checkFactorDB(n):
"""See if the modulus is already factored on factordb.com,
and if so get the factors"""
# Factordb gives id's of numbers, which act as links for full number
# follow the id's and get the actual numbers
r = requests.get('http://www.factordb.com/index.php?query=%s' % str(n))
regex = re.compile("index\.php\?id\=([0-9]+)", re.IGNORECASE)
ids = regex.findall(r.text)
# These give you ID's to the actual number
num = len(ids)-2
print(ids)
print(num)
if num < 2: return 0
else: return num * (num-1) / 2
#print solve('1ELuX8Do1NDSMy4eV8H82dfFtTvKaqYyhg')
评论列表
文章目录