Lehmer's GCD algorithm: Difference between revisions

Content deleted Content added
Undid revision 700004815 by 119.158.46.18 (talk) an implementation uses only one radix/base
m link, ce etc.
Line 10:
** Decrease ''m'' by one. Let ''x'' be the leading (most significant) digit in ''a'', ''x''&nbsp;=&nbsp;''a''&nbsp;div&nbsp;''β''<sup>&nbsp;''m''</sup> and ''y'' the leading digit in ''b'', ''y''&nbsp;=&nbsp;''b''&nbsp;div&nbsp;''β''<sup>&nbsp;''m''</sup>.
** Initialize a 2&nbsp;by&nbsp;3 [[matrix (mathematics)|matrix]]
*::<math>\textstyle
\begin{bmatrix} A & B & x\\ C & D & y \end{bmatrix}
</math> to an extended [[identity matrix]] <math>\textstyle
\begin{bmatrix} 1 & 0 & x \\ 0 & 1 & y\end{bmatrix},
</math>
Line 21:
**::<math>\textstyle \begin{bmatrix} A & B & x \\ C & D & y \end{bmatrix}</math>
**: with the matrix product
**:: <math>\textstyle
\begin{bmatrix} 0 & 1 \\ 1 & -w \end{bmatrix}
\cdot
\begin{bmatrix} A & B & x \\ C & D & y \end{bmatrix}
= \begin{bmatrix} C & D &y \\ A - wC & B - wD & x-wy \end{bmatrix}
</math>
Line 35:
<references/>
 
* [[Kapil Hari Paranjape|Kapil Paranjape]], [http://www.imsc.res.in/~kapil/crypto/notes/node11.html Lehmer's Algorithm]
 
{{Number-theoretic algorithms}}