Skip to content

Commit

Permalink
Minor algebraic simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
rhettinger committed Jan 8, 2024
1 parent 35fa13d commit 1e3ae0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Doc/library/itertools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,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


Expand Down

0 comments on commit 1e3ae0c

Please sign in to comment.