#include #include #include #include #include #include #include #include #include #define basemax 50 #define sizek 25 // code base lgmin@lgmax // explores families of numbers (on the standard input file) of kind s1{d}s2 // to find primes of length between lgmin and lgmax // found (probably) primes are sent to the standard error file // families where nothing is found are sent to a newleft file // details of the exploration are sent to the standard output using namespace std; using sint=long unsigned int; // std::vector >::size_type; char tr[128]; sint w[128]; sint b,i,lgmin,lgmax,nbcurl,nbcurlmin,nbcurlmax; vector found; string covering; bool newl; struct elem{string p;string s1;string s2;string s;sint y;mpz_class z1,z2,bx; bool finished;}; elem pi; vector vpi; ifstream kern; ofstream result; bool cover(string el) // checks if some member of found is a substring of el {sint i,j,it; for(it=0;it!=found.size();it++) {if(el==found[it]){covering=found[it];return true;} if(el.length()=(found[it]).length()){covering=found[it];return true;} if(i>=el.length())break; } else {i++;if(i>=el.length())break;} } } return false; } int main(int argc, char *argv[]) {string p,ms,prefms,s,s1,s2,ss,sss; sint i,lg,l1,l2,y,rpr; bool cont; mpz_class z,z1,z2,bx,zz1,zz2,zzz; ms=argv[1];b=stoi(argv[1]); prefms="kernel"+ms;kern.open(prefms.c_str()); prefms="newleft"+ms;result.open(prefms.c_str()); while(kern>>p) {found.push_back(p); } if(argc>2){s=argv[2]; for(i=0;ibasemax){cerr<<"base too large\n";return 1;} for(char c='0';c<='9';c++){w[c]=0+c-'0';tr[0+c-'0']=c;} for(char c='A';c<='Z';c++){w[c]=10+c-'A';tr[10+c-'A']=c;} for(char c='a';c<='z';c++){w[c]=36+c-'a';tr[36+c-'a']=c;} while(cin>>p) {z1=0;l1=0;s1="";s2=""; cont=false; for(i=0;i=b){cout<=b){cout<=b){cout<1){cout<