Looking at Wikipedia's example for Dixon's Factorization Method, it shows the following.
We will try to factor N = 84923 using bound B = 7. Our factor base is then P = {2, 3, 5, 7}. We then search random for integers between
ceil(sqrt(84923), which equals 292 and N whose squares are B-smooth.
At this point, my understanding is that a number x is B-smooth if its factors only include P, which equals {2, 3, 5, 7} in this example.
513^2 mod 84923 = 8400 = 2^4 * 3 * 5^2 * 7
537^2 mod 84923 = 33600 = 2^6 * 3 * 5^2 * 7
Is there any particular factorization that's used to get 8400's and 33600's factors?
(513 * 537)^2 mod 84923 = (275831)^2 mod 84923
= (84923 * 3 + 20712)^2 mod 84923
= (84923 *3)^2 + 2 * (84923 * 3 * 20712) + 20712^2 mod 84923 = 0 + 0 + 20712^2 mod 84923
Please explain the second, third and fourth lines. I don't understand the transition from the first to the second line.
That is,
20712^2 mod 84923 = (2^5 * 3 * 5^2 * 7)^2 mod 84923 = 16800^2 mod 84923The resulting factorization is
84923 = gcd(20712 - 16800, 84923) x gcd(20712 + 16800, 84923) = 163 * 521
In the calculation below we apply some rules of modular arithmetic and division of integers
\begin{align*} (513\cdot537)^2&\mod 84923\\ &=\color{blue}{275481}^2\mod 84923\tag{1}\\ &=(84923\cdot 3+20712)^2\mod 84923\tag{2}\\ &=(84923\cdot3)^2+2\cdot(84923\cdot3\cdot20712)+20712^2\mod 84923\tag{3}\\ &=0+0+20712^2\mod 84923\tag{4} \end{align*}
Comment:
In (1) note that $513\cdot 537=275481$ (and not $275831$)
In (2) we use the Euclidean algorithm $275481=q*84923+r$ with $q\in \mathbb{Z}$ and $0\leq r<84923$ ($q=3$ and remainder $r=20712$)
In (3) we apply the binomial theorem $(a+b)^2=a^2+2ab+b^2$
In (4) we use
\begin{align*} a^n\mod b&=(a\mod b)^n\\ (a\cdot b)\mod c&=(a\mod c)\cdot (b\mod c) \end{align*} together with the fact that integer multiples of the modulus $84923$ are zero.
Note: This statement is some kind of summary of the calculations in the example above, since
Another view of the same thing is
\begin{align*} 20712^2&=(2^3\cdot3\cdot863)^2=428986944=5051\cdot84923 + \color{blue}{40871}\\ 16800^2&=(2^5\cdot3\cdot5^2\cdot7)^2=282240000=3323\cdot 84923+\color{blue}{40871} \end{align*} Since both $20712^2$ and $16800^2$ have the same remainder $\color{blue}{40871}$ by division of $84923$, we observe
\begin{align*} 20712^2\mod 84923 &= 40871\\ 16800^2\mod 84923 &= 40871 \end{align*} or equivalently \begin{align*} (2^3\cdot3\cdot863)^2\mod 84923 &= 40871\\ (2^5\cdot3\cdot5^2\cdot7)^2\mod 84923 &= 40871 \end{align*}