Recessional velocity

From formulasearchengine
Revision as of 23:34, 19 August 2013 by en>Jamesx12345 (add {{reflist}} (here's hoping!))
Jump to navigation Jump to search

Template:Expert-subject

Shanks' square forms factorization is a method for integer factorization devised by Daniel Shanks as an improvement on Fermat's factorization method.

The success of Fermat's method depends on finding integers x and y such that x2y2=N, where N is the integer to be factored. An improvement (noticed by Kraitchik) is to look for integers x and y such that x2y2(modN). Finding a suitable pair (x,y) does not guarantee a factorization of N, but it implies that N is a factor of x2y2=(xy)(x+y), and there is a good chance that the prime divisors of N are distributed between these two factors, so that calculation of the greatest common divisor of N and xy will give a non-trivial factor of N.

A practical algorithm for finding pairs (x,y) which satisfy x2y2(modN) was developed by Shanks, who named it Square Forms Factorization or SQUFOF. The algorithm can be expressed in terms of continued fractions, or in terms of quadratic forms. Although there are now much more efficient factorization methods available, SQUFOF has the advantage that it is small enough to be implemented on a programmable calculator.

Algorithm

Input: N, the integer to be factored, which must be neither a prime number nor a perfect square, and a small multiplier k.

Output: a non-trivial factor of N.

The algorithm:

Initialize P0=kN,Q0=1,Q1=kNP02.

Repeat

bi=kN+Pi1Qi,Pi=biQiPi1,Qi+1=Qi1+bi(Pi1Pi)

until Qi is a perfect square.

Initialize b0=kNPi1Qi,P0=b0Qi+Pi1,Q0=Qi,Q1=kNP02Q0

Repeat

bi=kN+Pi1Qi,Pi=biQiPi1,Qi+1=Qi1+bi(Pi1Pi)

until Pi+1=Pi.

Then if f=gcd(N,Pi) is not equal to 1 and not equal to N, then f is a non-trivial factor of N. Otherwise try another value of k.

Shanks' method has time complexity O(N4).

Stephen S. McMasters (see link in External Link section) wrote a more detailed discussion of the mathematics of Shanks' method, together with a proof of its correctness.

Example

N = 11111, k = 1

P0 = 105 Q0 = 1 Q1 = 86

P1 = 67 Q1 = 86 Q2 = 77

P2 = 87 Q2 = 77 Q3 = 46

P3 = 97 Q3 = 46 Q4 = 37

P4 = 88 Q4 = 37 Q5 = 91

P5 = 94 Q5 = 91 Q6 = 25

Here Q6 is a perfect square

P0 = 104 Q0 = 5 Q1 = 59

P1 = 73 Q1 = 59 Q2 = 98

P2 = 25 Q2 = 98 Q3 = 107

P3 = 82 Q3 = 107 Q4 = 41

P4 = 82

Here P3 = P4

gcd(11111, 82) = 41, which is a factor of 11111.

References

  • 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534
  • 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534
  • 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534

External links

Template:Number theoretic algorithms