Skip to content

Instantly share code, notes, and snippets.

@prabhakar711
Last active October 21, 2015 10:42
Show Gist options
  • Save prabhakar711/b7076d6c2592b43e92cb to your computer and use it in GitHub Desktop.
Save prabhakar711/b7076d6c2592b43e92cb to your computer and use it in GitHub Desktop.
Project Euler Problem 1
Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2015-10-14T22:07:03+05:30
====== Project Euler ======
Created Wednesday 14 October 2015
Problem 1:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5
The previously posted answer isn't correct. The statement of the problem is to sum the multiples of 3 and 5 below 1000, not up to and equal 1000. The correct answer is
∑k1=13333k1+∑k2=11995k2−∑k3=16615k3=166833+99500−33165=233168,
∑k1=13333k1+∑k2=11995k2−∑k3=16615k3=166833+99500−33165=233168,
where we have the used the identity
Ref :
http://math.stackexchange.com/questions/9259/find-the-sum-of-all-the-multiples-of-3-or-5-below-1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment