Skip to content

Instantly share code, notes, and snippets.

@mrklein
Created September 8, 2012 14:30
Show Gist options
  • Save mrklein/3675439 to your computer and use it in GitHub Desktop.
Save mrklein/3675439 to your computer and use it in GitHub Desktop.
Euler 87
#!/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