Loading ...
Sorry, an error occurred while loading the content.

ad prime connection

Expand Messages
  • Jon Perry
    More of an interesting fact actually, but if n has two consecutive ads 3 apart (e.g.4,7), then n is not prime. This can be (visually) extended to any odd
    Message 1 of 1 , Jun 4, 2002
    • 0 Attachment
      More of an interesting fact actually, but if n has two consecutive ads 3
      apart (e.g.4,7), then n is not prime. This can be (visually) extended to any
      odd integers. Note 'consecutive' is important.

      This script allows experimentation with this result, via this line:

      if (ads[j]==ads[j+1]-3) {ds+='*';}

      This is the output for 3:

      10,12,25,27,28,33,45,46,49,57,60,63,66,68,72,74,77,85,87,92,93,94,104,105,11
      0,115,116,117,123,130,132,136,143,147,148,150,153,161,165,175,177,183,186,18
      7,188,195,200,203,204,206,207,212,213,214,230,234,235,236,237,238,243,247,25
      2,255,259,267,268,270,273,275,280,290,292,294,297,303,304,305,308,310,315,32
      4,325,326,327,333,344,345,346,348,354,357,363,368,372,374,375,380,387,393,39
      5,399,403,408,410,412,413,417,423,425,428,430,437,447,450,453,462,465,466,46
      8,475,477,483,486,492,494,500,504,507,511,513,514,515,532,537,543,548,550,55
      2,553,556,561,565,567,570,572,573,574,580,585,588,594,597,603,605,606,610,62
      4,626,627,628,633,634,652,654,655,657,663,665,667,675,676,682,687,690,692,69
      3,695,696,697,708,710,712,717,723,732,735,737,745,746,747,748,752,753,759,76
      0,764,766,770,772,774,775,777,783,790,791,793,794,795

      ---

      <html>
      <head>
      <title>Anti-Divisors</title>
      <script>
      ad=new Array();
      for (i=0;i<800;i++,ad[i]='') {}
      for (i=3;i<800;i++) {
      if (i%100==0) status=i;
      imax=2*Math.floor(i/3)+1;
      for (j=2;j<i;j++) {
      if (j>imax) break;
      j2=j%2;
      if ((j2==0) && ((i-j)%j==Math.floor(j/2))) ad[i]=ad[i]+j+'.';
      else if ((j2==1) && ((i-j)%j==Math.floor((j+1)/2))) ad[i]=ad[i]+j+'.';
      else if ((j2==1) && ((i-j)%j==Math.floor((j-1)/2))) ad[i]=ad[i]+j+'.';
      }
      }

      sc=0;
      dc=0;
      tc=0;
      qc=0;
      sinS=new Array();
      douS=new Array();
      triS=new Array();
      quaS=new Array();

      for (i=2;i<ad.length;i++) {
      ads=ad[i].split('.');
      ds='';
      for (j=0;j<ads.length-1;j++)
      if (ads[j]==ads[j+1]-3) {ds+='*';}

      if (ds=='*' || ds=='**' || ds=='***') sinS[sc++]=i;
      if (ds=='**' || ds=='***' || ds=='****') douS[dc++]=i;
      if (ds=='***' || ds=='****') triS[tc++]=i;
      if (ds=='****') quaS[qc++]=i;

      document.write(i+'::'+ad[i]+' '+ds+'<br>');
      }

      document.write('<br>');
      document.write(sinS+'<br>');
      document.write(douS+'<br>');
      document.write(triS+'<br>');
      document.write(quaS+'<br>');
      </script>
      </head>
      </html>

      ---

      Jon Perry
      perry@...
      http://www.users.globalnet.co.uk/~perry/maths
      BrainBench MVP for HTML and JavaScript
      http://www.brainbench.com
    Your message has been successfully submitted and would be delivered to recipients shortly.