Skip to content

Commit 3550533

Browse files
committed
Update factorization.md
clarifications
1 parent a708731 commit 3550533

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/algebra/factorization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ vector<long long> trial_division1(long long n) {
4343
This is an optimization of the trial division.
4444
Once we know that the number is not divisible by 2, we don't need to check other even numbers.
4545
This leaves us with only $50\%$ of the numbers to check.
46-
After checking 2, and determining it is an odd number, we can simply start with 3 and only count other odd numbers.
46+
After factoring out 2, and getting an odd number, we can simply start with 3 and only count other odd numbers.
4747
4848
```{.cpp file=factorization_trial_division2}
4949
vector<long long> trial_division2(long long n) {
@@ -70,10 +70,10 @@ So we only need to check the numbers $5, 7, 11, 13, 17, 19, 23, \dots$.
7070
We can observe a pattern of these remaining numbers.
7171
We need to check all numbers with $d \bmod 6 = 1$ and $d \bmod 6 = 5$.
7272
So this leaves us with only $33.3\%$ percent of the numbers to check.
73-
We can implement this by checking the primes 2 and 3 first, and upon discovering they are not divisible by said numbers, start with 5 and only count remainders $1$ and $5$ modulo $6$.
73+
We can implement this by factoring out the primes 2 and 3 first, after which we start with 5 and only count remainders $1$ and $5$ modulo $6$.
7474

7575
Here is an implementation for the prime number 2, 3 and 5.
76-
A convenient way to store skippable numbers is with an array.
76+
It is convenient to store skippable numbers in an array.
7777

7878
```{.cpp file=factorization_trial_division3}
7979
vector<long long> trial_division3(long long n) {

0 commit comments

Comments
 (0)