Created
December 22, 2018 00:06
-
-
Save CamDavidsonPilon/39560f562da0a9ed6b580ee1b2c6962f 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 falling_factorial(k, n): | |
product = 1 | |
counter = k | |
while counter > n: | |
product *= counter | |
counter -= 1 | |
return product | |
f = lambda k: 2 * falling_factorial(k, k-100) - k**100 | |
assert f(7174) < 0 | |
assert f(7175) > 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment