From 4fd0aaefacf27677adbf989178e8176010946ca0 Mon Sep 17 00:00:00 2001 From: Harpreet Singh <124236553+Harpreet287@users.noreply.github.com> Date: Mon, 30 Dec 2024 18:01:26 +0530 Subject: [PATCH] A little spell check that's it I corrected the typo by removing the extra "all" in the first sentence of [https://cp-algorithms.com/algebra/phi-function.html#etf_1_to_n]. It seems like a small mistake. Thanks for the tutorial, though! --- src/algebra/phi-function.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algebra/phi-function.md b/src/algebra/phi-function.md index 8129542f3..c69ee2841 100644 --- a/src/algebra/phi-function.md +++ b/src/algebra/phi-function.md @@ -73,7 +73,7 @@ int phi(int n) { ## 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 " } -If we need all all the totient of all numbers between $1$ and $n$, then factorizing all $n$ numbers is not efficient. +If we need the totient of all numbers between $1$ and $n$, then factorizing all $n$ numbers is not efficient. We can use the same idea as the [Sieve of Eratosthenes](sieve-of-eratosthenes.md). 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.