Pollard $p-1$: compute $a^{B!}$ modulo $n$ by raising to the power $B$ at step $B$, and check $\gcd(a^{B!}-1,n)$ each time.
Compare with the factorizations of $p-1$ and $q-1$:
Pollard $p-1$: compute $a^{B!}$ modulo $n$ by raising to the power $B$ at step $B$, and check $\gcd(a^{B!}-1,n)$ each time.
Compare with the factorizations of $p-1$ and $q-1$: