Diophantine equation implementation
<p>I've been asked to do the following: 
If it is possible to buy x, x+1,…, x+5 sets of McNuggets, for some x, then it is possible to buy any number of McNuggets >= x, given that McNuggets come in 6, 9 and 20 packs. Write an iterative program that finds the largest number of McNuggets that cannot be bought in exact quantity.</p>

<p>Here's the code i came up with, but it get's stuck in an infinite loop: </p>

<pre><code>count = 0
n = 1
while count &lt; 6:
    six_consequtive = True
    for a in range(n):
        for b in range(n):
            for c in range(n):
                if 6*a + 9*b + 20*c == n:
                    six_consequtive = False
    if six_consequtive:
        count += 1
    else:
        count = 0

    n += 1

print("Largest number of McNuggets that cannot be bought in exact quantity: %d." % (n - 5))
</code></pre>

<p>Thank you very much! </p>
