Skip to content

Instantly share code, notes, and snippets.

@sirkitree
Created April 10, 2012 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sirkitree/2351686 to your computer and use it in GitHub Desktop.
Save sirkitree/2351686 to your computer and use it in GitHub Desktop.
Project Euler challenge #1
// Project Euler challenge #1
// https://projecteuler.net/problem=1
var total = 0,
i = 1000;
while (i--) {
if (i % 3 === 0 || i % 5 === 0) {
total += i;
}
}
console.log(total);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment