Last active
December 3, 2021 12:47
-
-
Save igorvanloo/1ab152b6b7b93a2d3a28d79c985fefe1 to your computer and use it in GitHub Desktop.
pe136
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 compute(limit): #set limit to 5*10**6 | |
array = [0]*(limit) | |
for a in range(1, limit): | |
for d in range(int(math.floor(a/4))+1, a): | |
n = a*(4*d-a) | |
if n > limit-1: | |
break | |
else: | |
array[n] += 1 | |
return array.count(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment