Skip to content

Instantly share code, notes, and snippets.

@topokel
Last active December 21, 2015 09:59
Show Gist options
  • Select an option

  • Save topokel/6288778 to your computer and use it in GitHub Desktop.

Select an option

Save topokel/6288778 to your computer and use it in GitHub Desktop.
Eulerproject prob 1 solution
var eulerprob1 = {
multiples: [],
solver: function() {
for(i=0;i*3<1000;i++) {
this.multiples.push(i*3);
}
for(i=0;i*5<1000;i++) {
if(!(i*5 % 3 == 0)){
this.multiples.push(i*5);
}
}
var x = 0;
for(i=0;i<this.multiples.length;++i) {
x += this.multiples[i];
}
return x;
}
}
eulerprob1.solver();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment