def factors(x,i=0): if isprime2(x):return [x] p = sieve(int(x**.5)) for j,prime in enumerate(p[i:]): tmp = x%prime if tmp==0: tp = x//prime print(tmp,prime) return [prime]+factors(tp,j) return [x]
def factors(x, i=0): if isprime2(x): return [x] p = sieve(int(x**.5)) for j, prime in enumerate(p[i:]): tmp = x % prime if tmp == 0: tp = x // prime print(tmp, prime) return [prime] + factors(tp, j) return [x]
def e133(): L, q, s = 100000, pow(10, 20), 5 for p in sieve(L)[1:]: if pow(10, q, p) != 1: s += p return s
def e003(num=600851475143): p = sieve(round(num**.5)) for i in p[::-1]: if num % i: continue else: return i
def e003(num=600851475143): p = sieve(round(num**.5)) for i in p[::-1]: if num%i:continue else:return i
def e005(top=20): return reduce(mul,[i**(ceil(log(top)/log(i))-1) for i in sieve(top)])