Shanks's square forms factorization: Difference between revisions

Content deleted Content added
Line 26:
Start the second phase (reverse cycle).
 
Initialize <math>b_0=\left\lfloor\frac{P_0-P_i}{\sqrt{Q_{i+1}}}\right\rfloor</math> and <math>Q_0=\sqrt{Q_{i+1}}</math>, and <math>P_0=b_0\sqrt{Q_{i+1}}+P_i</math>, where <math>P_0, P_i</math>, and <math>Q_{i+1}</math> are from the previous phase. <math>b_0</math> used in the calculation of <math>P_0</math> is the recently calculated value of <math>b_0</math>.
 
Set <math> i=0</math> and <math> Q_1=\frac{kN-P_0^2}{Q_0}</math>.