Created
September 8, 2012 14:30
-
-
Save mrklein/3675439 to your computer and use it in GitHub Desktop.
Euler 87
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
#!/usr/bin/env python | |
from libeuler import primes | |
if __name__ == '__main__': | |
p = primes(7100) | |
res = set() | |
for s in p: | |
for c in p: | |
for q in p: | |
n = s*s + c*c*c + q*q*q*q | |
if n < 50000000: | |
res.add(n) | |
print len(res) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment