´

numberofpart

synopsis: INT numberofpart(OP n, result)

description:

numberofpart computes the number of partitions of the given weight n, which must be an INTEGER object. The result is an INTEGER object, or a LONGINTobject, according to the size of n.

return:

OK or ERROR.

example:

 This programm prints the number of partitions of weight up to 199.
 As you know this is big number, and the result for e.g. a=150
 will be no longer
 an INTEGER   object as for a=10, but a LONGINTobject.

#include "def.h"
#include "macro.h"
 main()
 {
 INT i;
 OP a,b;
 anfang();
 a = callocobject();
 b = callocobject();

 for (i=1L;i<200L;i++)
 {
 freeself(a); freeself(b); /* a,b are now empty objects */
 M_I_I(i,a);
 numberofpart(a,b);
 /* b is the number of partitions of weight a */
 print (a) ; println(b);
 }

 freeall(a);
 freeall(b);
 ende();
 }


Send comments or suggestions to:
symmetrica (at) symmetrica.de

this page was automatically generated on So Jan 4 10:35:49 CET 2009 on the machine btn6xf

University of Bayreuth -