MathGroup Archive 2004

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

Search the Archive

Mathematica slows down

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52956] Mathematica slows down
  • From: George Szpiro <george at netvision.net.il>
  • Date: Fri, 17 Dec 2004 05:20:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

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