Created
January 7, 2021 21:16
-
-
Save 0verflowme/81381b2a565f0c9ec5314c96d1dcf271 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def complex_tot(factors): | |
phi = 1 | |
for (p, e) in factors: | |
# Integer prime of this form is a Gaussian prime with norm(p) = p^2 | |
if p % 4 == 3: | |
phi *= (p**(e-1))**2 * (p**2 - 1) | |
# Integer prime of this form is factored into two Gaussian primes with norm(P) = p | |
elif p % 4 == 1: | |
phi *= (p**(e-1) * (p - 1))**2 | |
return phi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment