daily pastebin goal
65%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const primorial=2*3*5*7*11*13*17*19*23;
  2. var largest=0;
  3. // var gblist=[];
  4. // var tblist=[];
  5. // var sblist=[];
  6. var sblistlength=0;
  7. function hcfnaive(a,b){
  8.     if(b==0){
  9.       return a;
  10.     } else {
  11.       return hcfnaive(b,a%b);
  12.     }
  13.     return hcfnaive(b,a%b);
  14. }
  15.  
  16. for(i=0; i<primorial; i++){
  17.   var k=0
  18.   while(hcfnaive(i+k,primorial)!=1 || hcfnaive(i-k,primorial)!=1){
  19.     k=k+1
  20.     // if(k==165) sblist.push(i);
  21.     if(k==165) sblistlength = sblistlength+1;
  22.   }
  23.   // gblist.push(k);
  24.  
  25.   if(k>largest) largest=k;
  26. }
  27.  
  28. // for(t=0; t<primorial/2; t++){
  29. //   tblist.push(gblist[t]+gblist[t+primorial/2]);
  30. // }
  31. console.log(sblist);
  32. // console.log("length: " + sblist.length);
  33. console.log("length: " + sblistlength);
  34. console.log("largest: " + largest);
  35. console.log("primorial: " + primorial);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top