Jeroen wrote:
>to find the value v where prime p is a factor of 2^v-1
>
>tempvalue = p
>count = 0
>while tempvalue != 0
>{
>   if tempvalue is odd
>   {
>      shiftright tempvalue
>      count++
>   }
>   else
>   {
>      tempvalue+=p
>   }
>} ...
>

(Uh, did you swap your 'if' and 'else' clauses? if temp is odd do you want to shift 
the '1' off?)

As luck would have it, this is nearly what I am doing right now:

tempvalue = (q+1)/2
count = 1
while tempvalue != 1 {
   if tempvalue is odd   tempvalue += q 
   shiftright tempvalue
   count++
}
v = count
q is therefore a factor of the mersenne number 2^v - 1. If v is prime then M(v) is 
eliminated as a mersenne prime, so I keep a list of prime v's. I've crunched through 
all q < 2^23; soon I'll start submitting the high end of my list to GIMPS for removal 
from the candidate list. The one drawback is this method finds alot of v where q = 2v 
+ 1  (k = 1), which require q/2 times thru the loop. The program is really starting to 
slow down.

Back to the discussion
TSC wrote:
>Anyway, it must exist a great deal of low primes; which by now never
>can become mersenne factors (by reason: 2kp+1). So with two types of
>primes, those that are mersenne factors and those that never can be,
>do we have any means of distinguish them?

Remember that every odd number can be written in the form 2kp + 1 (p prime, k may be 
1), so that is not a limitation to being a factor.
You'll notice that 'tempvalue == 1' is only the exit condition for the loop above. 
This is because every prime is a factor of some mersenne number M(v) { plus the set of 
M(kv), which are all composite }.  Of course GIMPS is only interested in those where v 
is prime. My program will abort the loop and prompt me if count > (q-1)/2, indicating 
q isn't a factor of any M(v). It hasn't happened yet.

Regards,        

Bruce Leenstra
_________________________________________________________________________
Unsubscribe & list info -- http://www.ndatech.com/mersenne/signup.htm
Mersenne Prime FAQ      -- http://www.tasam.com/~lrwiman/FAQ-mers

Reply via email to