Einzelnen Beitrag anzeigen

mikeslash

Registriert seit: 28. Feb 2010
18 Beiträge
 
#1

sehr schneller Rechner gesucht

  Alt 18. Mär 2011, 21:05
Hallo,
würde mir jemand den Gefallen tun und mein Programm auf einem sehr schnellen Rechner laufen lassen? Mein acht Jahre alter Celeron hat hier keine Chance. Kann aber bestimmt einige Stunden in Anspruch nehmen. Das Programm sucht und ordnet bestimmte binäre Tupel der Collazt-Iteration und speichert das Ergebnis als "MIKES LISTE" im Verzeichnis C. Der Fortschritt im Algorithmus wird als Pixel in einem 500x500 Quadrat angezeigt. Würde die erste Linie schon 5 Minuten dauern, so läuft der Algorithmus mindestens 42 Stunden. Man kann also schnell erkennen, ob sich ein Weitersuchen überhaupt lohnt. Vielleicht kann mein Algorithmus aber auch beschleunigt werden, bin für jeden Tipp dankbar.

Viele Grüße,
Mike


Delphi-Quellcode:
var
  Form1: TForm1;

  b,c,g,u,x,uWert,Grenze: extended;
  i: integer;
  j,y: variant;
  k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12,k13,k14,k15,k16,k17,k18,k19,k20: integer;
    k21,k22,k23,k24,k25,k26,k27,k28,k29,k30: integer;
  h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13,h14,h15,h16,h17,h18,h19,h20,h21,h22,h23,h24,h25,h26,h27,h28,h29: integer;
  m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18,m19,m20,m21,m22,m23,m24,m25,m26,m27,m28: integer;
  Liste: TStringList;
  sn: array[0..100] of integer;



implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin


  Liste:=TStringList.Create;

  k1:=0; k2:=0; k3:=0; k4:=0; k5:=0; k6:=0; k7:=0; k8:=0; k9:=0; k10:=0;
  k11:=0; k12:=0; k13:=0; k14:=0; k15:=0; k16:=0; k17:=0; k18:=0; k19:=0; k20:=0;
  k21:=0; k22:=0; k23:=0; k24:=0; k25:=0; k26:=0; k27:=0; k28:=0; k29:=0; k30:=0;


  b:=3; u:=0; g:=0; j:=0; y:=0; Grenze:=84141805077; uWert:=30;


  repeat

    c:=b;
    repeat
      if frac((c+1)/2)=0 then begin c:=(3*c+1)/2; u:=u+1; end;
      if frac(c/2)=0 then c:=c/2;

      if u>uWert then break;

    until (c<b) and (frac((c+1)/2)=0);



    if u=uWert then begin

      i:=0; c:=b; g:=g+1;

      sn[i]:=1; i:=i+1;
      c:=(3*c+1)/2;
      repeat
        if frac(c/2)=0 then begin sn[i]:=0; i:=i+1; c:=c/2; end
                       else begin sn[i]:=1; i:=i+1; c:=(3*c+1)/2; end;
      until i>u;


      if (sn[0]=1) and (sn[1]=0)
      then k1:=k1+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=0)
      then k2:=k2+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=0)
      then k3:=k3+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=0)
      then k4:=k4+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=0)
      then k5:=k5+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=0)
      then k6:=k6+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=0)
      then k7:=k7+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=0)
      then k8:=k8+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=0)
      then k9:=k9+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=0)
      then k10:=k10+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=0)
      then k11:=k11+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=0)
      then k12:=k12+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=0)
      then k13:=k13+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=0)
      then k14:=k14+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=0)
      then k15:=k15+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=0)
      then k16:=k16+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=0)
      then k17:=k17+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=0)
      then k18:=k18+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=0)
      then k19:=k19+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=0)
      then k20:=k20+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=0)
      then k21:=k21+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=0)
      then k22:=k22+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=0)
      then k23:=k23+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=1) and (sn[24]=0)
      then k24:=k24+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=1) and (sn[24]=1)
                   and (sn[25]=0)
      then k25:=k25+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=1) and (sn[24]=1)
                   and (sn[25]=1) and (sn[26]=0)
      then k26:=k26+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=1) and (sn[24]=1)
                   and (sn[25]=1) and (sn[26]=1) and (sn[27]=0)
      then k27:=k27+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=1) and (sn[24]=1)
                   and (sn[25]=1) and (sn[26]=1) and (sn[27]=1) and (sn[28]=0)
      then k28:=k28+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=1) and (sn[24]=1)
                   and (sn[25]=1) and (sn[26]=1) and (sn[27]=1) and (sn[28]=1)
                   and (sn[29]=0)
      then k29:=k29+1;

      if (sn[0]=1) and (sn[1]=1) and (sn[2]=1) and (sn[3]=1) and (sn[4]=1)
                   and (sn[5]=1) and (sn[6]=1) and (sn[7]=1) and (sn[8]=1)
                   and (sn[9]=1) and (sn[10]=1) and (sn[11]=1) and (sn[12]=1)
                   and (sn[13]=1) and (sn[14]=1) and (sn[15]=1) and (sn[16]=1)
                   and (sn[17]=1) and (sn[18]=1) and (sn[19]=1) and (sn[20]=1)
                   and (sn[21]=1) and (sn[22]=1) and (sn[23]=1) and (sn[24]=1)
                   and (sn[25]=1) and (sn[26]=1) and (sn[27]=1) and (sn[28]=1)
                   and (sn[29]=1) and (sn[30]=0)
      then k30:=k30+1;



      x:=(g+1)/int(Grenze/250000);
      if frac(x)=0 then begin
                          j:=j+1;
                          if j>500 then begin j:=0; y:=y+1; end;
                          canvas.pixels[30+j,100+y]:=clblack;
                        end;


     end;



    b:=b+2; u:=0;

  until g>Grenze;


   h1:=k2-k1;
   h2:=k3-k2;
   h3:=k4-k3;
   h4:=k5-k4;
   h5:=k6-k5;
   h6:=k7-k6;
   h7:=k8-k7;
   h8:=k9-k8;
   h9:=k10-k9;
   h10:=k11-k10;
   h11:=k12-k11;
   h12:=k13-k12;
   h13:=k14-k13;
   h14:=k15-k14;
   h15:=k16-k15;
   h16:=k17-k16;
   h17:=k18-k17;
   h18:=k19-k18;
   h19:=k20-k19;
   h20:=k21-k20;
   h21:=k22-k21;
   h22:=k23-k22;
   h23:=k24-k23;
   h24:=k25-k24;
   h25:=k26-k25;
   h26:=k27-k26;
   h27:=k28-k27;
   h28:=k29-k28;
   h29:=k30-k29;

   m1:=h2-h1;
   m2:=h3-h2;
   m3:=h4-h3;
   m4:=h5-h4;
   m5:=h6-h5;
   m6:=h7-h6;
   m7:=h8-h7;
   m8:=h9-h8;
   m9:=h10-h9;
   m10:=h11-h10;
   m11:=h12-h11;
   m12:=h13-h12;
   m13:=h14-h13;
   m14:=h15-h14;
   m15:=h16-h15;
   m16:=h17-h16;
   m17:=h18-h17;
   m18:=h19-h18;
   m19:=h20-h19;
   m20:=h21-h20;
   m21:=h22-h21;
   m22:=h23-h22;
   m23:=h24-h23;
   m24:=h25-h24;
   m25:=h26-h25;
   m26:=h27-h26;
   m27:=h28-h27;
   m28:=h29-h28;

   Liste.Add(Format('%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d',

   [floor(m1), floor(m2), floor(m3), floor(m4), floor(m5), floor(m6), floor(m7), floor(m8), floor(m9), floor(m10),
   floor(m11), floor(m12), floor(m13), floor(m14), floor(m15), floor(m16), floor(m17), floor(m18), floor(m19), floor(m20),
   floor(m21), floor(m22), floor(m23), floor(m24), floor(m25), floor(m26), floor(m27), floor(m28)
   ]));

  Liste.SaveToFile('C:\MIKES LISTE.txt');

  showmessage('Fertig');

end;
  Mit Zitat antworten Zitat