So, from a post on another blog (Out of All the Possible Answers), I followed a link to Project Euler …
And then I read it to Kiir. The problem is to find the smallest number evenly divisble by all the numbers from 1-20. We decided that it didn’t mean at the same time, since that’s factorial
And then … *sigh* I felt compelled to find the answer. My answer and logic after the break
Basically what I did was try to figure out, roughly and quickly, what the minimum value would be.
I took 20, because it gave me 20 10 5 4 2 1, good start. Then I took 9, which gives me 9 and 3.
From those two 6 15 12 and 18 “fall out” (the combination of values, 3*2, 3*5, 3*4, 9*2)
Then I needed the prime numbers (7 11 13 17 19) because they can’t be dodged. They’re prime, after all.
After that I’m missing 16 and 8, so I multiplied by 4 (combined with the 2 and 4 from the 20 to give 8 and 16).
Then I realized that I maybe didn’t need the 20, so I took the primes, 5 9 and 16.
Both answers gave me 232,792,560 (well, the second way gave me a smaller number, but that was because I forgot the 7)
So … that’s my answer.
I don’t think you have it right. All you need to do is to multiply all the prime numbers under 20, and you magically get all the other numbers. The primes under 20 are:
2, 3, 65, 7, 11, 13, 17, 19
Multiply them together and you get:
$ bc -l
2*3*5*7*11*13*17*19
9699690
$
Umm… actually, you are right, you do need the squares, too, so multiply by an additional 2*2*2*3 and get 581,981,400.
You don’t need a second 5, because it doesn’t occur more than once in any number under 20. The killer is 16, which is 2*2*2*2 which requires four twos.
Yeah, my final result is 5*7*9*11*13*16*17*19
I think you punched in a 5 instead of a 2 in your second calcs, because your answer is 2.5x mine, with the same math
(oh, and welcome)