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?
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.
Woahh!!! How did you find this question? This question is a relic!!!
Thanks for teaching me something brand new!
The problem is same as finding the second largest non-negative integer a such that the equation 3 1 x + 1 3 y = a , has no solutions when x and y are non-negative integers.
After solving the equation when x and y are integers we get:
x = − 5 a + 1 3 k , y = 1 2 a − 3 1 k , where k is an integer
For fixed a , the equation above has a solution for non-negative integers x , y iff there exist an integer k for which 1 3 5 a ≤ k ≤ 3 1 1 2 a .
k
doesn't exist iff
1
3
5
a
and
3
1
1
2
a
have the same integer part, but aren't integers.
This is the same as saying that
k
doesn't exist iff there exists positive integers
n
<
1
3
,
m
<
3
1
such that
1
3
5
a
−
n
=
3
1
1
2
a
−
m
⟹
a
=
1
3
m
−
3
1
n
.
Now we can generate ALL values of
a
which cannot be expressed in form
3
1
x
+
1
3
y
where
x
,
y
are positive integers.
We maximize the value of
a
by keeping
m
as large as possible and
n
as small as possible, and thus get
a
=
1
3
⋅
3
0
−
3
1
⋅
1
=
3
5
9
.
Now we get the second smallest a by lowering the value of the largest a by the smallest possible amount.
Since lowering the value of m by 1 is better than adding 1 to the value of n and since we cannot add more to the value of m to compensate with larger n we get a = 1 3 ⋅ 2 9 − 3 1 ⋅ 1 = 3 4 6
Thank you for your solutionnn
Now find the third largest number!! =D
Log in to reply
I'm quite sure it is 333.
Log in to reply
Yesssssssssssss
Log in to reply
@Pi Han Goh – I just noticed that generalization of this proves the first theorem under Representability for n = 2 in Frobenius Number and in addition provides a fast algorithm to generate all numbers which cannot be represented.
Log in to reply
@Jesse Nieminen – Yes yes. Now find a closed form for n = 3 ahahah
Log in to reply
@Pi Han Goh – I would become famous if I did. :D
Problem Loading...
Note Loading...
Set Loading...
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 ( 1 3 , 3 1 ) = 1 3 ⋅ 3 1 − 1 3 − 3 1 = 3 5 9 , and then to use the fact (proved in the wiki) that any two nonnegative integers that sum to 3 5 9 have the property that exactly one of them is possible to buy. To maximize the impossible one, minimize the possible one. 0 is obviously the smallest (pairing with 3 5 9 ) and 1 3 is obviously the second smallest, which pairs with 3 4 6 . In general, the answer will be a b − a − b − min ( a , b ) , for coprime integers a , b .