by jopux
 P: 1 Is there a name for "factoring" addition? For example....let's say I'm working in a basis of all integers greater than 3. I can make 7 from 3+4; 8 from 4+4 or 3+5; 9 from 3+3+3 or 4+5 or 6+3....... Is there a name for this? And if so...are there computer programs that will generate these sets for me?
 Sci Advisor HW Helper P: 9,398 Look up partition functions.
P: 87
 Quote by jopux are there computer programs that will generate these sets for me?
try this

#include <stdio.h>

#define LOWEST 3

int n, c[1024];
FILE *out;

void add (int pos, int a, int sum) {
int i;
c[pos]=a;
if (sum>n) return;
if (sum==n) {
for (i=0;i<=pos;i++) fprintf(out, "%d ", c[i]);
fprintf(out, "\n");
return;
}
}

int main () {
int i;
printf("n: ");
scanf("%d", &n);
out=fopen("results.txt", "wt");
}