Find the sum of all the multiples of 3 or 5 below 1000.

For questions about problems on the Project Euler web site. No spoilers. Please include the question number in the subject line of your post.

Find the sum of all the multiples of 3 or 5 below 1000.

Postby mrlog101 » Thu May 30, 2013 12:02 pm

removed for spoilers
Last edited by mrlog101 on Thu May 30, 2013 2:01 pm, edited 1 time in total.
mrlog101
 
Posts: 3
Joined: Wed May 29, 2013 4:12 pm

Re: Find the sum of all the multiples of 3 or 5 below 1000.

Postby MichelFJM » Thu May 30, 2013 1:10 pm

Hello

Your result is right (if 1000 is included in the sum) and I have seen no mistake in your code
you also have the result with :
Code: Select all
sum(set(range(0,1001,3)+range(0,1001,5)))

Regards
MichelFJM
 
Posts: 19
Joined: Wed May 22, 2013 1:41 pm

Re: Find the sum of all the multiples of 3 or 5 below 1000.

Postby mrlog101 » Thu May 30, 2013 1:20 pm

Well the website I got the task from says it's incorrect, so I've either misunderstood the question or something else... I can't see what though.

The question is at http://projecteuler.net/problem=1 if you want to see and try to put the answer in.
mrlog101
 
Posts: 3
Joined: Wed May 29, 2013 4:12 pm

Re: Find the sum of all the multiples of 3 or 5 below 1000.

Postby stranac » Thu May 30, 2013 1:55 pm

1000 is not below 1000.
Last edited by stranac on Thu May 30, 2013 2:00 pm, edited 2 times in total.
Reason: Moved topic to Project Euler
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1117
Joined: Thu Feb 07, 2013 3:42 pm

Re: Find the sum of all the multiples of 3 or 5 below 1000.

Postby mrlog101 » Thu May 30, 2013 1:57 pm

Oh right... well that was stupid of me.
mrlog101
 
Posts: 3
Joined: Wed May 29, 2013 4:12 pm


Return to Project Euler

Who is online

Users browsing this forum: No registered users and 0 guests