mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2002-09-14, 16:35   #12
jocelynl
 
Sep 2002

10616 Posts
Default

:)to test a factor, all you need is the same algorythm that they use in prime95. you wish to test 2^9835211-1, so take the binary number of 9835211.
110100110100100001101001

here is a small basic programm

m=9835211
Factor=36293798558667431

fnModulo(Factor,m)
modulo=1
length=len(m)
for x=length to 0 step -1
modulo=(modulo*modulo) mod Factor
if bit(x,m)=1 then modulo=(2*modulo) mod Factor
next
return(modulo)

if modulo=1 then 36293798558667431 is a factor of 9835211
very fast algorythm.
jocelynl is offline   Reply With Quote
Old 2002-09-15, 02:16   #13
Daffy
 
Aug 2002

3110 Posts
Default

Quote:
Originally Posted by alpertron
That is, as a first step, you could do the the following:

Q <- 1
do 9835211 times: Q <- Q * 2 mod 36293798558667431
Q <- Q - 1

In this case you should get zero, so you found a factor.
Something very simple you could do and I will take an example:

2^15 mod 6 = (2^3)^5 mod 6 = 8^5 mod 6 = 2^5 mod 6 = 2^3 * 2^2 mod 6 = 2 * 4 mod 6 = 2

2^17 mod 7 = (2^3)^5 * 2^2 mod 7 = 8^5 * 4 mod 7 = 1^5 * 4 mod 7 = 4 mod 7 = 4


This works for all values: X mod Y can be calculated very fast this way.

There is no need to multiply 9835211 times q * 2 modulo ......

You just need to compute smaller values. I used this formula.

X*Y mod Z = XX * YY mod Z where XX = X mod Z and YY = Y mod Z.

The "difficult" part is to do it efficiently in the least amount of computations. But even if you waste a few, no big deal. It's still much faster. This is maybe what the other tools are doing.
Daffy is offline   Reply With Quote
Old 2002-09-15, 03:51   #14
toferc
 
Aug 2002

2·3·5 Posts
Default

jocelynl has got it quite right. It might help to look at the GIMPS home page quickie description of the algorithm at

http://www.mersenne.org/math.htm

under "Trial Factoring".

Chris Caldwell's Prime Pages glossary has an entry for the Binary Exponentiation algorithm upon which this is based:

http://primes.utm.edu/glossary/page.php?sort=BinaryExponentiation

HTH
toferc is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
'Verifying' a Mersenne prime vs. 'proving' it Rodrigo Information & Answers 28 2011-02-14 23:43
Missing factors at the 'Known Factors' page MatWur-S530113 PrimeNet 11 2009-01-21 19:08
I need some factors MatWur-S530113 Math 21 2007-05-12 19:36
The factors of 11,199- Jeff Gilchrist NFSNET Discussion 2 2004-09-27 23:40
Introducing GIMPS, Now Verifying M10,000,000+! E_tron Lounge 7 2003-09-16 21:30

All times are UTC. The time now is 16:24.


Fri Jul 7 16:24:51 UTC 2023 up 323 days, 13:53, 0 users, load averages: 2.37, 2.11, 1.69

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔