#include #include #include #include #include #include #include #include #include #define basemax 50 #define sizek 25 using namespace std; // code base lgmin@lgmax [lgmin [lgmax]] // explores a sigle family of numbers (on the standard input file) of kind s1{d}s2 // to find the first prime of length between lgmin and lgmax // if found the (probably) prime is sent to the standard error file // details of the exploration are sent to the standard output 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; ifstream kern; ofstream result; int main(int argc, char *argv[]) {string p,ms,prefms,s,ss,sss; sint i,l1,l2,y,rpr; mpz_class z,z1,z2,bx; ms=argv[1];b=stoi(argv[1]); if(argc>2){s=argv[2]; for(i=0;ibasemax){cerr<<"base trop grande\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;} cin>>p;z1=0;l1=0; cout<=b)abort(); z1=z1*b+w[p[i]];l1++; } if(p[i+2]!='}')abort(); y=w[p[i+1]];if(y>=b)abort(); z2=0;bx=1;l2=0; for(i=i+3;i=b)abort(); bx=bx*b;z2=z2*b+w[p[i]];l2++; } while(l1+l2