Skip to content

Instantly share code, notes, and snippets.

@gavinsykes
Created April 29, 2020 21:25
Show Gist options
  • Select an option

  • Save gavinsykes/679d5ba6c859e582e07e255034c4feb1 to your computer and use it in GitHub Desktop.

Select an option

Save gavinsykes/679d5ba6c859e582e07e255034c4feb1 to your computer and use it in GitHub Desktop.
const euler_1 = n => {
let result = 0,
x = n/3,
y = n/5
for (let i = 1; i < x; i++) {
result += i*3;
}
for (let i = 1; i < x; i++) {
if (5*i % 3 != 0) {
result += i*5;
}
}
return result;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment