Problem 42888. Frobenius McNugget Factorization
Mr. Frobenius McNugget is a peculiar man.
As you might expect, he likes to eat Chicken McNuggets. But his love of number theory influences his appetite in strange ways. On any given day he wakes up with a desire for a specific number of McNuggets. If that number is 19, then no other number of McNuggets will do. But the McFastFood restaurant down the street serves McNuggets only in quantities of 6, 9, or 20 to a box. So he can be satisfied on a 21 nugget day, but on a 19 nugget day he must go hungry. To make matters more interesting, the restaurant often changes the quantities in their boxed McNuggets.
Given the box counts nuggets, what is the highest number frob for which Frobenius must go hungry? nuggets is a vector of positive integers with two or more elements.
Examples
nuggets = [2 5] frob = 3
nuggets = [6 9 20] frob = 43
Solution Stats
Problem Comments
-
4 Comments
In test #2: 43 = 3+2*20, I've got frob = 37. In test #3: 207 = 17+10*19. I've got frob = 175;
Got same results with Jan.
A nice place to check the results: http://mathsjavascript.free.fr/frobenius_9_page.html
My apologies gentlemen! I rushed this into print yesterday afternoon. Thanks for the reference Peng. I have fixed the offending answers.
Solution Comments
Show commentsProblem Recent Solvers21
Suggested Problems
-
1374 Solvers
-
714 Solvers
-
896 Solvers
-
Return fibonacci sequence do not use loop and condition
546 Solvers
-
56 Solvers
More from this Author50
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!