Problem 001
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
-
sharkz
- Posts: 4
- Joined: Thu Jan 13, 2011 8:48 pm
Re: Problem 001
yes and 15 is a multiple of both 3 and 5, and because of that, my program counts it two times (so 2x +15 to sum) - or is this wrong?
- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
-
wygk123
- Posts: 3
- Joined: Wed Feb 09, 2011 2:10 pm
- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
Re: Problem 001
Besides, your solution seems rather slow when the limit is changed to 10^18In particular don't post any code fragments or results.
-
alto
- Posts: 2
- Joined: Mon Feb 14, 2011 11:29 pm
Problem 001
I'm almost positive that I did it correctly so if there's someone I could PM what I used to find the answer, that'd be great.
-
TripleM
- Posts: 384
- Joined: Fri Sep 12, 2008 3:31 am
Re: Problem 001
There's already a thread for problem 1 here: viewtopic.php?f=50&t=965
If you still haven't worked out the problem after reading those 5 pages, feel free to PM me (but not before
)
If you still haven't worked out the problem after reading those 5 pages, feel free to PM me (but not before
-
alto
- Posts: 2
- Joined: Mon Feb 14, 2011 11:29 pm
Re: Problem 001
They were using c++ as hints but I'm running it in python. I read through all 5 pages and got no tip at all. So I'll PM you the small code 
- formicFabricant
- Posts: 3
- Joined: Fri Mar 25, 2011 4:00 pm
Re: Problem 001
I read through the entire old thread (the one that's unlocked after you give the correct answer) and I couldn't find a single Ruby solution under 60 chars! Honestly...I came up with one in 51 and I'm sure I could do better.
- kevinsogo
- Administrator
- Posts: 1204
- Joined: Thu Sep 16, 2010 4:39 am
- Location: Manila, Philippines
Re: Problem 001
@formicFabricant
Although a very short code is nice and elegant, I don't think it would add much to the discussion.
I've not coded in ruby before but after installing ruby and a few reading I was able to write a 44-character ruby program that solves problem 1. If you're interested I could PM it.
Although a very short code is nice and elegant, I don't think it would add much to the discussion.
I've not coded in ruby before but after installing ruby and a few reading I was able to write a 44-character ruby program that solves problem 1. If you're interested I could PM it.
-
RodL
- Posts: 1
- Joined: Fri Apr 29, 2011 5:03 am
Needing help understanding Problem 1
By the sum of multiples of 3 OR 5 we mean to gather the sum of multiples of both 3 and 5 making sure that we only add the LCM of both 3 & 5 once (ex, 15 being the LCM of 3 and 5, we would only add 15 ONCE to the total summation rather than twice when 5*3 is reached.)
I'm getting like 80,000+ as my sum because 3*333 being the top-most multiple that equates to below 1000. But why is the solution much, much lower than 80,000?
If I could PM my code that would be great to someone.
I'm getting like 80,000+ as my sum because 3*333 being the top-most multiple that equates to below 1000. But why is the solution much, much lower than 80,000?
If I could PM my code that would be great to someone.
-
TripleM
- Posts: 384
- Joined: Fri Sep 12, 2008 3:31 am
Re: Needing help understanding Problem 1
Please use existing threads if one exists - here's the one for problem 1: viewtopic.php?f=50&t=965
If you've read all 5 pages of that and are still stuck, then (and only then
) you can PM me.
(PS - I'm not sure where you heard the answer was much less than 80000, but that's not true.)
If you've read all 5 pages of that and are still stuck, then (and only then
(PS - I'm not sure where you heard the answer was much less than 80000, but that's not true.)
- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Problem 001
@RodL
For ease of listing alphabetically and searching in this topic, all problem numbers have 3 digits, using leading 0's for problem numbers under 100.
For ease of listing alphabetically and searching in this topic, all problem numbers have 3 digits, using leading 0's for problem numbers under 100.
When you assume something, you risk being wrong half the time.
-
SyGeek
- Posts: 2
- Joined: Sat Jun 04, 2011 2:29 am
Re: Problem 001
Is it possible to find the answer by adding some of each groups (0-10, 10-20, 20-30 and so on) by following the pattern that each consecutive group has a difference of 47.
70(10-20) - 23(0-10) = 47
117(20-30) - 70(10-20) = 47
70(10-20) - 23(0-10) = 47
117(20-30) - 70(10-20) = 47
- jaap
- Posts: 588
- Joined: Tue Mar 25, 2008 3:57 pm
- Contact:
Re: Problem 001
0-9: 3+5+6+9 = 23SyGeek wrote:Is it possible to find the answer by adding some of each groups (0-10, 10-20, 20-30 and so on) by following the pattern that each consecutive group has a difference of 47.
70(10-20) - 23(0-10) = 47
117(20-30) - 70(10-20) = 47
10-19: 10+12+15+18 = 55
20-29: 20+21+24+25+27 = 117
30-39: 30+33+35+36+39 = 173
-
SyGeek
- Posts: 2
- Joined: Sat Jun 04, 2011 2:29 am
Re: Problem 001
^Just found that I don't have to add 15 x 2 times...Meh, maths is not for me. I'll still try though
-
Yemen
- Posts: 1
- Joined: Mon Jun 06, 2011 7:01 am
Re: Problem 001
Using python I used a similar brute force solution to many others
After which I found a simple, elegant, one-line solution
Although there's probably a way that this can be made simpler and quicker...
Expand
Expand
- Lord_Farin
- Posts: 239
- Joined: Wed Jul 01, 2009 10:43 am
- Location: Netherlands
Re: Problem 001
Would you now please take the time and read the BIG RED BOX on top of the page, and act accordingly? Thanks in advance. Please excuse my outburst as you are not the first person to ignore the obvious. Again, this is a publicly visible forum, and people may or may not have already solved problem 1. You are spoiling it for them.Yemen wrote:Using python I used a similar brute force solution to many othersAfter which I found a simple, elegant, one-line solutionCode: Select all
[snip]Although there's probably a way that this can be made simpler and quicker...Code: Select all
[snip]

- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 001
Yemen, you're probably new here, but when entering a new place, it would show good manners if you would read the rules before posting.
I sent you a warning.
Please remove your spoilers.
@Lord_Farin: if this kind of behaviour starts irritating you, just ignore. The admins will handle in a few minutes/hours more.
I sent you a warning.
Please remove your spoilers.
@Lord_Farin: if this kind of behaviour starts irritating you, just ignore. The admins will handle in a few minutes/hours more.

War ruins the life and health of untold numbers of innocent children.
- Lord_Farin
- Posts: 239
- Joined: Wed Jul 01, 2009 10:43 am
- Location: Netherlands
Re: Problem 001
You are absolutely right. Thanks for stating the obvious. I appreciate what you and the rest of the team go through to keep it enjoyable for everyone. Thanks again.hk wrote:@Lord_Farin: if this kind of behaviour starts irritating you, just ignore. The admins will handle in a few minutes/hours more.

- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 001
No problem. I'm pleased to keep the site running, even if that means some additional tasks.Lord_Farin wrote:You are absolutely right. Thanks for stating the obvious. I appreciate what you and the rest of the team go through to keep it enjoyable for everyone. Thanks again.hk wrote:

War ruins the life and health of untold numbers of innocent children.
