Created
May 16, 2022 16:13
-
-
Save igorvanloo/1f7cdcc9531c3bd3f639b0feabd1eb57 to your computer and use it in GitHub Desktop.
Legendres Formula
This file contains hidden or 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 legendre_factorial(x): | |
primes = list_primes(a) | |
prime_fac = {} | |
for y in primes: | |
total = 0 | |
for i in range(1, int(math.floor(math.log(x, y))) + 1): | |
total += int(math.floor(x / (y ** i))) | |
prime_fac[y] = total | |
return prime_fac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment