from math import sqrt def f(n): i = 1 while i <= sqrt(n): if n % i == 0: print(str(i) + " " + str(n / i)) i += 1 print("And that's all the integer factors of " + str(n)) 3, 8: c_1 4, 5, 6, 7: c_2 c_1 + c_2 sqrt(n) Theta(sqrt(n))