MathGroup Archive 2007

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

Search the Archive

How to do quickest


Probably these procedure isn't possible to do much quicker because limit  
is time of single PrimeQ checking but mayby somebody is able do some  
quickest (these procedure looking for prime numbers of the form  
1+4+4^2+4^3+...4^x (mayby number 5 is only one such number ???):

a = {}; k = 0; Timing[Do[k = k + 4^x; If[
   PrimeQ[k], Print[k]; AppendTo[a, k]], {x, 0, 10000}]; a]

PrimeQ is relatively quick but working only up to upper limit, later is  
necessary uses NumberTheory packagae and much more slowest procedures.

BEST WISHES
ARTUR




  • Prev by Date: Re: Numerical quantifier elimination
  • Next by Date: Problem with ExpIntegralEi vs. LogIntegral
  • Previous by thread: Re: NDSolve -- initial conditions
  • Next by thread: Re: How to do quickest