Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (16 sloc) 363 Bytes
# coding: utf-8
def factor(n):
s = ''
p = 2
while n > 1 and n >= p:
if n % p == 0:
count = 0
while n % p == 0:
n = int(n / p)
count += 1
s += '{}({})'.format(p, count)
p += 1
return s
if __name__ == "__main__":
print(factor(72))
print(factor(181944))
You can’t perform that action at this time.