An integer partition of n is a weakly decreasing list of positive integers which sum to n.
For example, there are 7 integer partitions of 5:
[5], [4,1], [3,2], [3,1,1], [2,2,1], [2,1,1,1], [1,1,1,1,1].
Write a function named partitions which returns the number of integer partitions of n.  The function should be able to find the number of integer partitions of n for n as least as large as 100.
dic={}
def partitions(n,x=None, maxx=None):
    x,maxx = (n,n) if x==None else (x,maxx)
    return sum([dic[(x-i,i)] if (x-i,i) in dic else(0 if dic.update({(x-i,i):partitions(n,x-i,i)}) else dic[(x-i,i)])for i in range(1,min([maxx,x])+1)[::-1]]) if x else 1
dic={}
def partitions(n,x=None, maxx=None):
    x,maxx = (n,n) if x==None else (x,maxx)
    return sum([dic[(x-i,i)] if (x-i,i) in dic else(0 if dic.update({(x-i,i):partitions(n,x-i,i)}) else dic[(x-i,i)])for i in range(1,min([maxx,x])+1)[::-1]]) if x else 1