Skip to content

Instantly share code, notes, and snippets.

@clauswitt
Created July 4, 2011 19:00
Show Gist options
  • Select an option

  • Save clauswitt/1063783 to your computer and use it in GitHub Desktop.

Select an option

Save clauswitt/1063783 to your computer and use it in GitHub Desktop.
Euler9.js
var sys = require('sys');
var Euler9 = function() {
for(var a = 1; a < 1000; a++) {
for(var b = a+1; b < 1000; b++) {
c = Math.sqrt(Math.pow(a,2)+Math.pow(b,2));
if(c==Math.round(c)) {
if(1000===a+b+c) {
sys.puts(a*b*c);
}
}
}
}
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment