def get_submultiples(n):
# Get all submultiples of n
if n == 1:
return [1]
i = 2
submultiples = set([1,n])
m = n
while i < m:
if n % i != 0:
m = int(n/i)+1
else:
submultiples.add(i)
submultiples.add(int(n/i))
i += 1
return submultiples
- this algorithm wrote by myself, I want to know what is its O(?). Can anybody help me?
- it wrote by python and "n" is an integer.