#include #include #include #include #include #include #include #include "BigIntegerLibrary.hh" using namespace std; vector v; vector primers; vector > factors; string int2string(int n){ stringstream s; s << n; //el numero n passa a ser s return(s.str()); } void binomial(vector& vp, unsigned long long int n2, vector& bino, unsigned long long int step, unsigned long long int n1, vector >& resultats){ unsigned long long int a; unsigned long long int major1 = vp[step]; unsigned long long int major2 = vp[step-1]; BigInteger resultat = 1; for(unsigned long long int j=major1+1; j<=n1; j++){ string jj = int2string(j); BigInteger jjj =stringToBigInteger(jj); resultat = resultat*jjj; } for(unsigned long long int w=0; w& v, unsigned long long int step, vector >& resultats){ unsigned long long int one; if(n<1) return ; v[step]=n; int m = step+1; unsigned long long int sumatot = 0; //cout< bino; binomial(v, n, bino, step, sumatot, resultats); if(step==0){ one = 1; } else{ one = v[step-1]; } for(unsigned long long int i=one; i<=n/2; i++){ v[step]=i; partitio(n-i, v, step+1, resultats); } } void garbell(){ v[0]=false; v[1]=false; factors[0].push_back(0); factors[1].push_back(1); for(unsigned long long int i=2; i>n; v = vector (n, true); primers = vector (); factors = vector > (n); garbell(); //cout<<"last: "<