In [1]:
from sympy import factorint
In [2]:
# When using the python console (iPad), uncomment the following lines to get user input
# s=raw_input("? ")
# n=int(s)
# n hardcoded for this notebook to 324 = 18*18
n=18*18
print("factorint output ->", factorint(n))
nhalf = int(n/2)
factorcount=0
for x in range(1,nhalf+1):
if(n%x == 0):
print(x)
factorcount += 1
#plus one more, since n is a factor of n
print(n)
factorcount += 1
print(factorcount, " factors")