Partition of a positive integer N Find the number of partitions of a positive integer n. Hope someone uses the explicit finite formula for the partition function defined in Jan Hendrik Brunier and Ken Ono paper here.
Sample Input
8
Sample Output
22

N is less than or equal to 1000.
Write the complete program. More than anything I would like to see the different approaches.
Python (109 89)

n=input()
s=0
l=[(n,n)]
while l:a,i=l.pop(0);s+=a==0;l+=[(a-i,i),(a,i-1)]*(a*i&gt;0)
print s