You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/algebra/fft.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ It is easy to see that
97
97
98
98
$$A(x) = A_0(x^2) + x A_1(x^2).$$
99
99
100
-
The polynomials $A_0$ and $A_1$are only half asmuch coefficients as the polynomial $A$.
100
+
The polynomials $A_0$ and $A_1$have only half asmany coefficients as the polynomial $A$.
101
101
If we can compute the $\text{DFT}(A)$ in linear time using $\text{DFT}(A_0)$ and $\text{DFT}(A_1)$, then we get the recurrence $T_{\text{DFT}}(n) = 2 T_{\text{DFT}}\left(\frac{n}{2}\right) + O(n)$ for the time complexity, which results in $T_{\text{DFT}}(n) = O(n \log n)$ by the**master theorem**.
Copy file name to clipboardExpand all lines: src/algebra/phi-function.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ int phi(int n) {
73
73
74
74
## Euler totient function from $1$ to $n$ in $O(n \log\log{n})$ { #etf_1_to_n data-toc-label="Euler totient function from 1 to n in <script type=\"math/tex\">O(n log log n)</script>" }
75
75
76
-
If we needall allthe totient of all numbers between $1$ and $n$, then factorizing all $n$ numbers is not efficient.
76
+
If we need the totient of all numbers between $1$ and $n$, then factorizing all $n$ numbers is not efficient.
77
77
We can use the same idea as the [Sieve of Eratosthenes](sieve-of-eratosthenes.md).
78
78
It is still based on the property shown above, but instead of updating the temporary result for each prime factor for each number, we find all prime numbers and for each one update the temporary results of all numbers that are divisible by that prime number.
Copy file name to clipboardExpand all lines: src/algebra/sieve-of-eratosthenes.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,9 @@ And we continue this procedure until we have processed all numbers in the row.
19
19
20
20
In the following image you can see a visualization of the algorithm for computing all prime numbers in the range $[1; 16]$. It can be seen, that quite often we mark numbers as composite multiple times.
21
21
22
-
<center></center>
22
+
<divstyle="text-align:center;">
23
+
<imgsrc="sieve_eratosthenes.png"alt="Sieve of Eratosthenes">
24
+
</div>
23
25
24
26
The idea behind is this:
25
27
A number is prime, if none of the smaller prime numbers divides it.