I needed integer partitioning a few years ago, so implemented the z1 algorithm, for larger numbers it got pretty slow so I also implemented it in C, which I used to cache results to file, and then read, but you may also be able to call and parse it using .unixCmd
// SuperCollider
~zs1 ={|n=5|
var x, m, h, r, t, ret;
x=Array.fill(n, 1);
x[0]=n;
m=0;
h=0;
ret = List[n];
while({x[0] != 1}, {
if(x[h] == 2) {
m = m+1;
x[h] = 1;
h = h-1;
} {
r = x[h]-1;
t=(m-h+1);
x[h] = r;
while({t>=r},{
h=h+1;
x[h]=r;
t= t-r;
});
if(t==0) {
m=h
} {
m=(h+1);
if(t>1) {
h=(h+1);
x[h] = t;
};
};
};
ret.add(x[0..m]);
});
ret;
};
//C
#include <stdlib.h>
#include <stdio.h>
void zs1(size_t n, FILE *fd)
{
size_t i, m, h, r, t;
size_t *x;
x = malloc(sizeof(*x)*(n+1));
for (i = 1; i <= n; i++)
x[i] = 1;
x[1] = n;
m = 1;
h = 1;
fprintf(fd,"%zd\n",x[1]);
while (x[1] != 1) {
if (x[h] == 2) {
m = m + 1;
x[h] = 1;
h = h - 1;
} else {
r = x[h] - 1;
t = m - h + 1;
x[h] = r;
while (t >= r) {
h = h + 1;
x[h] = r;
t = t -r;
}
if (t == 0) {
m = h;
} else {
m = h + 1;
if (t > 1) {
h = h + 1;
x[h] = t;
}
}
}
for (i = 1; i <= m; i++)
fprintf(fd,"%zd ",x[i]);
fprintf(fd,"\n");
}
free(x);
}
int main(int argc, char**argv)
{
int first_arg = 0;
if(argc > 1) {
first_arg = atoi(argv[1]);
} else {
printf("must pass integer as argument\n");
return 0;
}
// printf("Partitioning: %d\n", first_arg);
zs1(first_arg, stdout);
return 0;
}