Is the answer to problem 3 of problem set 2, 43?
Sounds reasonable. I'm working on that one too right now, but haven't got it. Could you please post your program?
yeah , 43 is my solution too . I think it's the right answer !
Thanks Alwahsh. Damon, I would post the code, but I've chopped it up trying to solve the next problem and didn't save the original. I made a set of multiples of 6, another of multiples of 9 and then multiples of 20 (up to 50 since we know the theorem applies above 50). I added the sets(lists) together, inclusive of the originals. Then I sorted the set from least to greatest. Then I sifted out the repeated numbers. The result was a list of solutions up to 50. 44 through 48 (x, x+1, x+2, etc.) were all solutions, so I knew that I could stop at 43.
yes I think it was 43.
Joe, I pretty much used the same concept and used a variable 'consecutive' to check if you had a certain amount of solutions in a row (which in this case is the minimum of the packsizes at 6) my code is a little messy, and I had to write a 'dotproduct' function because it was the first way I could come up with (solve ax + by + cz = n). I'm pretty sure everyone else have much more elegant solutions. My code is below http://codepad.org/WPFEYmV0
Join our real-time social learning platform and learn together with your friends!