Skip to content

Instantly share code, notes, and snippets.

@igorvanloo
Created May 15, 2022 04:40
Show Gist options
  • Save igorvanloo/94fc4046c349098113a39edaf6dac066 to your computer and use it in GitHub Desktop.
Save igorvanloo/94fc4046c349098113a39edaf6dac066 to your computer and use it in GitHub Desktop.
p221
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