Algorithm 11653

1: root = int(N ** 0.5) + 1 if N % 2 == 0: N //= 2 print(2) else: j = 3 while N % j != 0 and j <= root: j+=2 if j >= root: result.append(N) N = 1 else: N //= j result.append(j) for i in sorted(result): print(i)