#include #include #include #include #include #include #include #include #include // #include // #include // #include "big.h" /* include MIRACL system */ #define basemax 50 #define sizek 25 // code base lgmin@lgmax n@m // explores families of numbers (on the standard input file) // to find primes of length between lgmin and lgmax, with a number of repetitions between n and m // (if a repetition contains several digits, they are considered as a block) // 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]; int w[128]; sint b,i,lgmin,lgmax,nbcurl,nbcurlmin,nbcurlmax; vector found; string covering; bool newl; 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; } string stripf(string p) {string s=""; sint i,j; for(i=0;ilgmax){cout<<" too LONG\n";return false;} if(cover(str)){cout<"; while(pr.length()<=lgmax) {str=stripf(pr);if(cover(str)){cout<lgmax)newl=true; return false; } } int main(int argc, char *argv[]) {string p,ms,prefms,s,ss,sss; sint i; ms=argv[1];b=stoi(argv[1]); prefms="kernel"+ms;kern.open(prefms.c_str()); prefms="newleft"+ms; result.open(prefms.c_str(),ios::out); while(kern>>p) {found.push_back(p); } if(argc>2){s=argv[2]; for(i=0;i3){s=argv[3]; 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) {cout<=b)abort();} if(nbcurlnbcurlmax) {result<