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/phi-function.md
+1-1Lines changed: 1 addition & 1 deletion
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 need all all the 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.
0 commit comments