Skip to content

Instantly share code, notes, and snippets.

@JoshuaJWilborn
Created December 13, 2012 16:07
Show Gist options
  • Save JoshuaJWilborn/4277477 to your computer and use it in GitHub Desktop.
Save JoshuaJWilborn/4277477 to your computer and use it in GitHub Desktop.
include Math
class Fixnum
def sqrt
Math.sqrt(self)
end
end
puts (1..(1001.sqrt.ceil)).find{ |a| ((a.succ)..1001.sqrt.ceil).find{ |b| ((b.succ)..1000).find{|c| (a + b == c) && (a**2+b**2==c**2) && c == 1000 }}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment