MathGroup Archive 2005

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

Search the Archive

Prime[..] slows down

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53524] Prime[..] slows down
  • From: George Szpiro <george at netvision.net.il>
  • Date: Sat, 15 Jan 2005 21:07:53 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

My last posting did not have the program listing:


can somebody explain why Prime[...] slows down so drastically and so 
abruptly at about 105
million (see below)?

also: how can I get elapsed time in fractions of seconds? (Timing[...] did
not work inside the loop for some reason.)AboluteTime to give

Thanks,

George
george at netvision.net.il




Sets=100;

KK=20000;

InitValue=105000000;

Steps=10000;

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

  TT=AbsoluteTime[];

  For[j=1,j<=KK,j++, x=2*Prime[InitValue+k*Steps+j];]



    Print["Prime[",InitValue+k*Steps+j-1,"]=",Prime[InitValue+k*Steps+j-1]," 
Time ",AbsoluteTime[]-TT];

  TT=AbsoluteTime[];]






Prime[105010000]=2145604099 Time 1.00000

Prime[105030000]=2146031753 Time 2.00000


  • Prev by Date: Re: Problem with DSolve
  • Next by Date: Re: Problem with DSolve
  • Previous by thread: Prime[] slows down
  • Next by thread: Re: Prime[..] slows down