Created
May 15, 2022 04:40
-
-
Save igorvanloo/94fc4046c349098113a39edaf6dac066 to your computer and use it in GitHub Desktop.
p221
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 Divisors_of(x): # Find the divisors of a number | |
divisors = [] | |
for i in range(1, int(math.sqrt(x)) + 1): | |
if x % i == 0: | |
divisors.append(i) | |
return (divisors) | |
def compute(): | |
alexandrian_integers = [] | |
p = 1 | |
while len(alexandrian_integers) < 500000: | |
for k in Divisors_of(p*p + 1): | |
alexandrian_integers.append(p*(p + k)*((p*p + 1)//k + p)) | |
p += 1 | |
return sorted(alexandrian_integers)[149999] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment