From 0b31a50ecd494d76e4254d4b2de18e5926683124 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:22:42 +0100 Subject: [3.12] Minor algebraic simplification for the totient() recipe (gh-113822) (gh-113823) --- Doc/library/itertools.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index a018161..67dc8f6 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -1142,7 +1142,7 @@ The following recipes have a more mathematical flavor: # https://mathworld.wolfram.com/TotientFunction.html # totient(12) --> 4 because len([1, 5, 7, 11]) == 4 for p in unique_justseen(factor(n)): - n = n // p * (p - 1) + n -= n // p return n -- cgit v0.12