MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Mathematica slows down


Hello,

the following program runs ok for the first 6,000 iterations, then slows 
down considerably, and then seems to speed up again after 10,000. Does 
anyone know what is going on?

Thanks,
George


NumP=15000;

For[k=1,k<NumP,k++,

  Gap[1]=Prime[k+1]-Prime[k];
  Gap[2]=Prime[k+2]-2Prime[k+1]+Prime[k];
  Gap[3]=Prime[k+3]-3Prime[k+2]+3Prime[k+1]-Prime[k];
  Gap[4]=Prime[k+4]-4Prime[k+3]+6Prime[k+2]-4Prime[k+1]+Prime[k];

  If[Mod[k,1000]==0, Print[ k]]


  ]



  • Prev by Date: slow eigenvectors and eigenvalues
  • Next by Date: Re: fullsimplify problem
  • Previous by thread: Re: Re: slow eigenvectors and eigenvalues
  • Next by thread: Re: Mathematica slows down