Source code for titan_pylib.math.get_quotients
[docs]
1def get_quotients(n: int) -> list[int]:
2 i = 1
3 a = []
4 while i * i <= n:
5 a.append(n // i)
6 a.append(n // (n // i))
7 i += 1
8 a.sort()
9 if not a:
10 return a
11 b = [a[0]]
12 for i in range(1, len(a)):
13 if b[-1] != a[i]:
14 b.append(a[i])
15 return b