def gen_divisors(n): a = [] for i in range(1,n+1): if i*i>n: break if n%i==0: a.append(i) if i*i