Partition function by ninjalj

function p(k,n){return m[n,k]=m[n,k]?m[n,k]:k<n?p(k+1,n)+p(k,n-k):k==n}END{for(;++i<101;)print"p("i")="p(1,i)}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page