|
| quote: | Originally posted by Noisician
just remembered one decent math problem/riddle i had to solve recently.
there are a certain number of books lying on the floor that u need to pack in boxes via tying them up into packages. u first try to make some packages with only 4 books in each, but then u notice that, at the end, 1 book is left unpacked. u then try to make a number of packages with 5 books in each, which also leaves only 1 book left. so u make packages with 6 books in each, which, once again, yields one single book remaining on the floor. finally, tying up 7 books together leaves u no additional books whatsoever. my question is, *at least* how many books had to be lying on the floor?
it's pretty easy, though |
4a + 1 = n
5b + 1 = n
6c + 1 = n
7q = n
n is divisible by 7.
n - 1 divisible by 4,5 and 6. lcm(4,5,6) = 60. thus n-1 is divisible
by 60.
so need only consider those n, such that n-1 divisible by 60, and n itself is divisible by 7.
n - 1 = 60a
n = 7b.
hence: 60a + 1 = 7b. Now we can solve this using Euclid's GCD algorithm.
done.
___________________
My Blog: durafei.blogspot.com - Last Update March 23, 2006
|