Skip to content

Instantly share code, notes, and snippets.

@kgullion
Created October 29, 2014 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kgullion/6adc2d633038ff852923 to your computer and use it in GitHub Desktop.
Save kgullion/6adc2d633038ff852923 to your computer and use it in GitHub Desktop.
def neely_v4(limit):
for x in range(1, limit):
xx = x*x
y = x + 1
z = y + 1
while z <= limit:
zz = xx + y*y
while z*z < zz:
z += 1
if z*z == zz and z <= limit:
yield (x, y, z)
y += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment