Skip to content

Instantly share code, notes, and snippets.

@seaslee
Created October 24, 2012 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seaslee/3945442 to your computer and use it in GitHub Desktop.
Save seaslee/3945442 to your computer and use it in GitHub Desktop.
solution to problem 1 of euler project
function y=ep1(n)
%exhaustive method to computer the sum of multiples of 3 or 5 which is below n
y=0;
for i=1:n-1,
if mod(i,3)==0 || mod(i,5)==0,
y=y+i;
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment