Are you kidding me?

In a special fast food restaurant, you can only order buckets of Chicken McNuggets in quantities of either 13 a bucket or 31 a bucket. What is the second largest number of Chicken McNuggets that its impossible to buy?


The answer is 346.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Patrick Corn
Mar 13, 2016

I threw this into the wiki on the Frobenius number .

The easiest way to compute this is to note that the largest such number is g ( 13 , 31 ) = 13 31 13 31 = 359 , g(13,31) = 13\cdot 31 -13-31 = 359, and then to use the fact (proved in the wiki) that any two nonnegative integers that sum to 359 359 have the property that exactly one of them is possible to buy. To maximize the impossible one, minimize the possible one. 0 0 is obviously the smallest (pairing with 359 359 ) and 13 13 is obviously the second smallest, which pairs with 346 346 . In general, the answer will be a b a b min ( a , b ) , ab-a-b-\text{min}(a,b), for coprime integers a , b a,b .

Woahh!!! How did you find this question? This question is a relic!!!

Thanks for teaching me something brand new!

Pi Han Goh - 5 years, 3 months ago
Jesse Nieminen
Jul 21, 2016

The problem is same as finding the second largest non-negative integer a a such that the equation 31 x + 13 y = a 31x + 13y = a , has no solutions when x x and y y are non-negative integers.

After solving the equation when x x and y y are integers we get:

x = 5 a + 13 k x = -5a + 13k , y = 12 a 31 k y = 12a - 31k , where k k is an integer

For fixed a a , the equation above has a solution for non-negative integers x , y x, y iff there exist an integer k k for which 5 a 13 k 12 a 31 \dfrac{5a}{13} \leq k \leq \dfrac{12a}{31} .

k k doesn't exist iff 5 a 13 \dfrac{5a}{13} and 12 a 31 \dfrac{12a}{31} have the same integer part, but aren't integers.
This is the same as saying that k k doesn't exist iff there exists positive integers n < 13 , m < 31 n < 13,m < 31 such that 5 a n 13 = 12 a m 31 a = 13 m 31 n \dfrac{5a-n}{13} = \dfrac{12a-m}{31} \implies a = 13m - 31n .

Now we can generate ALL values of a a which cannot be expressed in form 31 x + 13 y 31x + 13y where x , y x,y are positive integers.
We maximize the value of a a by keeping m m as large as possible and n n as small as possible, and thus get a = 13 30 31 1 = 359 a = 13 \cdot 30 - 31 \cdot 1= 359 .

Now we get the second smallest a a by lowering the value of the largest a a by the smallest possible amount.

Since lowering the value of m m by 1 1 is better than adding 1 1 to the value of n n and since we cannot add more to the value of m m to compensate with larger n n we get a = 13 29 31 1 = 346 a = 13 \cdot 29 - 31 \cdot 1= \boxed{346}

Thank you for your solutionnn

Now find the third largest number!! =D

Pi Han Goh - 4 years, 10 months ago

Log in to reply

I'm quite sure it is 333.

Jesse Nieminen - 4 years, 10 months ago

Log in to reply

Yesssssssssssss

Pi Han Goh - 4 years, 10 months ago

Log in to reply

@Pi Han Goh I just noticed that generalization of this proves the first theorem under Representability for n = 2 n = 2 in Frobenius Number and in addition provides a fast algorithm to generate all numbers which cannot be represented.

Jesse Nieminen - 4 years, 10 months ago

Log in to reply

@Jesse Nieminen Yes yes. Now find a closed form for n = 3 n=3 ahahah

Pi Han Goh - 4 years, 10 months ago

Log in to reply

@Pi Han Goh I would become famous if I did. :D

Jesse Nieminen - 4 years, 10 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...