Skip to content

Instantly share code, notes, and snippets.

@yask123
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yask123/90d04159d5f96d4d4c37 to your computer and use it in GitHub Desktop.
Save yask123/90d04159d5f96d4d4c37 to your computer and use it in GitHub Desktop.
import collections
import e3#importing previous pyton file for findfactor() function , sorry for seperating !
a=e3.findfactors(100)#Called the opther function using namespace
print(a)
counter=collections.Counter(a)#Return a dictionary of frequency of elements in the prime list
pro=1#will store the product of (a+1)*(b+1).. explained in the blog
for each_key in counter:
pro*=(counter[each_key]+1)#Calculate (a+1)*(b+1)*...etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment