Created
February 26, 2024 23:29
-
-
Save matthewraaff/58dab8faee8eaf3d066057fd3d01a8cb to your computer and use it in GitHub Desktop.
find multiple quick (solve Jevons's number) - python
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 findMulti(num: int) -> tuple: | |
limit = int(num ** 0.5) + 1 | |
for a in range(1, limit): | |
if num % a == 0: | |
b = num // a | |
if not 1 in (a, b): | |
return a, b | |
return False | |
print(findMulti(8616460799)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment