Problem 005

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
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.

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


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
deisner
Posts: 1
Joined: Wed Aug 26, 2009 10:16 pm

Problem 005

Post by deisner »

I believe there's a minor typo in 005_overview.pdf. Lest I be accused of spoiling anything, I'll try not to divulge too much:

In the first sentence of the eighth paragraph, "the p th" should actually read "the i th".

By the way, I just discovered Project Euler. This is fantastic! I think my copy of TAOCP will be getting a workout soon.
User avatar
daniel.is.fischer
Posts: 2400
Joined: Sun Sep 02, 2007 11:15 pm
Location: Bremen, Germany

Re: Problem 005

Post by daniel.is.fischer »

deisner wrote:I believe there's a minor typo in 005_overview.pdf. Lest I be accused of spoiling anything, I'll try not to divulge too much:

In the first sentence of the eighth paragraph, "the p th" should actually read "the i th".
Well spotted, thanks.
By the way, I just discovered Project Euler. This is fantastic! I think my copy of TAOCP will be getting a workout soon.
Great. Have fun.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
timhuff
Posts: 2
Joined: Mon May 17, 2010 6:40 pm

Re: Problem 005

Post by timhuff »

There's a rather small error with problem 5. I'm not trying to be pedantic, but the correct solution to the problem, as stated, is zero. Adding the qualifier "natural" to "numbers" would fix it. Figured I'd give you guys a heads up.
User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 10:43 am
Location: Netherlands

Re: Problem 005

Post by Lord_Farin »

I agree on this comment, one should state positive integer instead of number imo
Image
User avatar
hk
Administrator
Posts: 11040
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 005

Post by hk »

Well, eh, nobody commented on this in the nine years that the problem was around.
I added "positive". I did not add integer. Nobody thinks about evenly divisible for non-integers.
(That otherwise the solution is 0 is also open to debate: one could also argue that there isn't such a smallest number actually: it could also be "-infinity")
Image
timhuff
Posts: 2
Joined: Mon May 17, 2010 6:40 pm

Re: Problem 005

Post by timhuff »

No one mentioned it because they figure everyone knows what you meant. I figured I'd try out "zero" as an answer at first, though. Thought maybe it was a trick question (even though that doesn't exactly feel like the name of the game on this site). Excellent site, by the way. I'm having a lot of fun on these challenges.
User avatar
hk
Administrator
Posts: 11040
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 005

Post by hk »

Although some question have built in pitfalls, we don't publish trick questions as far as I know.
But kudos for seeing the incorrectness of the problem statement.
Image
ralph.corderoy
Posts: 3
Joined: Tue May 18, 2010 11:28 am

Re: Problem 005

Post by ralph.corderoy »

What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
I was mislead by the "evenly divisible" bit. I thought each of 1 to 20 had to divide into the number an even number of times. So I started with the LCM(1..20), but 232,792,560 / 16 = 14,549,535 which is odd so I went to LCM(2..40 step 2). But that isn't the accepted answer, <snip> is. I only understood what was meant when discussing with a friend my reasoning.

Can the use of "evenly divisible" on the site, not just this problem, be clarified please, e.g. "exactly divisible".
Last edited by harryh on Tue May 18, 2010 6:34 pm, edited 1 time in total.
Reason: Removed the (correct) answer - harryh
TripleM
Posts: 382
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 005

Post by TripleM »

Evenly divisible is a very commonly used and well defined phrase. You might have misunderstood it due to not knowing what the words mean, but it does not need clarification [see, eg, http://en.wiktionary.org/wiki/evenly_divisible]
User avatar
hk
Administrator
Posts: 11040
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 005

Post by hk »

Besides: at least in my browser the words "evenly divisible" are underlined with a dotted green line.
This means that there is tooltip available: hover over those words with your mouse and you get some more information.
Image
ralph.corderoy
Posts: 3
Joined: Tue May 18, 2010 11:28 am

Re: Problem 005

Post by ralph.corderoy »

TripleM wrote:Evenly divisible is a very commonly used and well defined phrase.
Is it an Americanism? I'm not familiar with it after some decades of interest in maths in the UK.

This book on Google, http://books.google.co.uk/books?id=ebx9 ... ly&f=false, says it's misleading and suggests "exactly divisible".

http://en.wikipedia.org/wiki/Parity_(mathematics) says "(The old-fashioned term "evenly divisible" is now almost always shortened to "divisible".)".
ralph.corderoy
Posts: 3
Joined: Tue May 18, 2010 11:28 am

Re: Problem 005

Post by ralph.corderoy »

hk wrote:Besides: at least in my browser the words "evenly divisible" are underlined with a dotted green line.
This means that there is tooltip available: hover over those words with your mouse and you get some more information.
I saw the dotted line and tried clicking on it but nothing happened. It didn't occur to me to leave the mouse over it, unmoving, for a prolonged period. If that short tooltip is necessary then it suggests the original phrase is unclear.
User avatar
hk
Administrator
Posts: 11040
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 005

Post by hk »

Well, you know now to to with that dotted line, don't you?
Image
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 005

Post by elendiastarman »

ralph.corderoy, you may want to edit your post as you gave the correct answer. Given that these forums are accessible by everyone, we wouldn't want to spoil the problem for some people now would we? ;)
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
Ocifer
Posts: 4
Joined: Thu Nov 25, 2010 7:09 pm

Re: Problem 005

Post by Ocifer »

I'm having issues with troubleshooting. My program computes the lcm of the 1,2,...,10 correctly, as well as other examples I've done by hand to check. I keep getting an incorrect answer when I got from 1 to 20... how can I trouble shoot and show code without spoiling anything?
User avatar
hk
Administrator
Posts: 11040
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 005

Post by hk »

You can PM your code to me.
Image
shulhi
Posts: 1
Joined: Mon Jan 03, 2011 7:46 pm

Re: Problem 005

Post by shulhi »

I've been having problem with this challenge. I have verified my code using the original question (1-10) instead of (1-20). It shows the list of all the numbers, and I have verified it manually. It works.

But, once I change my condition to (1-20), it doesn't work anymore. I'm using brute-force method, but instead of stepping the number one by one, I'm stepping it by 10 (based on math logic). Anyway, I've tried both. But still no result.
rakantae
Posts: 4
Joined: Wed Jan 05, 2011 12:40 am

Re: Problem 005

Post by rakantae »

Well, I solved this one, but I used a brute force method. It takes my computer 1.27 seconds to run it, though. I feel like that's too long. Is there any way to solve this problem without using prime numbers like the pdf?
User avatar
rayfil
Administrator
Posts: 1406
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: Problem 005

Post by rayfil »

Is there any way to solve this problem without using prime numbers like the pdf?
You could try paper and pencil. 8-)
When you assume something, you risk being wrong half the time.
Inglonias
Posts: 5
Joined: Tue Feb 15, 2011 12:42 pm

Re: Problem 005

Post by Inglonias »

I solved it by brute forcing it in java, but I'm sad because I know that there's a better way to do it. I looked at the overview, but I didn't understand it.
Post Reply