Wednesday, October 24, 2012

Project Euler Problem 44

A simpler one: https://projecteuler.net/problem=44
l= [(3*n*n-n)/2 for n in xrange(1,2500)]
d= dict((x, 1) for x in l)

for e1 in l:
 for e2 in l:
  if e1+e2 in d:
   if e2-e1 in d:
    print e2-e1

No comments:

Post a Comment