The Wine Puzzle
So, my sister hit me with this cute math puzzle a few months ago. It goes like this:
I had to tinker with the problem for quite a while before I finally
found my way "into" the problem. It opened my eyes to discrete math
a little. Although I've seen other people come up with the right
answer, they seem to do it by just numerically trying different
numbers until they get it. I've never seen anybody post a solution
using algebra, so I do that here.
A wine importer received a large consignment of bottles of wine from his favourite French vineyard.
On Day 1, he immediately celebrated by drinking one of the bottles.
On Day 2, he sold exactly a fifth of the remaining bottles, which was a good enough excuse to treat himself to a second bottle.
On Day 3, he again sold exactly one fifth of the bottles he had in stock at the beginning of the day. So again he celebrated with a bottle for himself.
This pattern continued until the end of the seventh day, when the number of bottles left no longer made it possible for him to dispose of a fifth of them on the eighth day.
How many bottles did the wine importer have when he started?
First off, for our solution, let’s ignore Day 1. It’s the only day where there’s not an auction. On all of the other days, the importer follows the following pattern: “Sell one fifth of the stock, then drink one bottle”. Once we figure out how many bottles he had before the auction on Day 2, we can just add one bottle and we’ll have the amount for Day 1. So, the real meat of the puzzle lies on days 2-7.
Now, let's define some terms.
Let's call the quantity of bottles immediately before each auction to be Q.
And, let's keep track of the quantities on each day with the notation Q(d), where 'd' is the number of the day. So, for example, Q(3) is the number of bottles he has in stock before the auction on day 3.
Next, let's formalize some of the details of the puzzle in terms of math equations.
- On each day, he sells 1/5 of the quantity and then drinks one more bottle. So, the next day (d+1), he retains 4/5 of his "day 'd'" stock, minus one:
Q(d+1) = 4/5 ⋅ Q(d) - 1 [equation #1] (valid for d=2 ... 7)
the equation is only valid when d is the day of an auction (which is why it doesn't apply to d=1). So, an example, Q(7) = 4/5 ⋅ Q(6) - 1. In other words, the “Day 7” quantity is four fifths of the Day 6 quantity, minus one.
Now, we have to put the equation aside for a moment and think about how some of these numbers have to be related to each other.
Because he sells off 1/5 of his stock in each auction, the before-auction quantity (Q) must be an integer multiple of 5. (If it weren’t, then, when we divided it by 5, we’d get a fraction). What do the integer multiples of 5 look like? They're 5, 10, 15, 20, 25, 30, etc... See how the last digit is always 0 or 5?
Now consider what the quantities immediate after the auction look like (ie, before he drinks a celebratory bottle). Because he sold off 1/5 of his stock, he has 4/5 of it left. So, immediately after an auction, he has 4/5⋅Q. This means that the AFTER AUCTION QUANTITY MUST BE A MULTIPLE OF 4. (If you’re having trouble seeing why this is so, note that this is because multiplying something by 4/5 is the same as dividing by 5 and then multiplying by 4. Because we’ve decided that the before-auction quantity must be a multiple of 5, then we must still have an integer after we divide by 5 and before we multiply by 4. So, after we multiply by 4, we’ll have a multiple of 4). What do the multiples of 4 look like? They look like 4, 8, 12, 16, 20, 24, 28, 32... etc. The important thing to note is that the last digit is always 0, 4, 8, 2, or 6.
Okay, so before each auction, he must have a quantity ending in 0 or 5. After each auction, he must have a quantity ending in 0, 4, 8, 2, or 6.
Now, after each auction, he drinks a single bottle, and then he's ready for the next auction.
I'll restate it with the mathematical implications: After each auction (ie, he has a quantity ending in 0, 4, 8, 2, or 6), he drinks a bottle (ie, he subtracts 1 from the quantity), and then he's ready for the next auction (ie, he has a quantity ending in 0 or 5)
Now, I’ll list only the mathematical implications: He has a quantity ending in either 0, 4, 8, 2, or 6. Then he subtracts 1. Then he has a quantity ending in either 0 or 5.
Ponder. That. For. A. Moment.
See it? There’s only one pair of quantities which will work. It only works if the after-auction quantity ends in 6, then he drinks a bottle, and then he has a quantity ending in 5. It doesn’t work for any other pairs of ending digits.
Okay, so we need multiples of 4 that end with the number 6 which are one higher than multiples of 5 which end in 5.
Those turn out to be:
16 - 1 = 15
36 - 1 = 35
56 - 1 = 55
76 - 1 = 75
…
So, now we have further constrained what the values of Q can be. The before auction quantities must come from the series: 15, 35, 55, 75, 95, etc.
It would be nice if we had an equation which gave us those numbers. Well, notice how the numbers are increasing by 20 each time? So, we could write something like:
Q = 20⋅n - 5
where n is 1, 2, 3, 4, etc. If you plug in those numbers for n, then you’ll see that the equation gives 15, 35, 55, etc.
Now, because each day has a different quantity, then there will be a different n which we’d plug into our new equation to get that quantity. So, just like we keep track of each day’s quantity with Q(d), we’ll need to keep track of each day’s ‘n’ with n(d).
Lastly (and this is really important), this equation doesn’t apply to all of the days. Remember that this equation gives multiples of 5 which are 1 less than some other multiple of 4. The requirement that it is a multiple of 5 is because an auction is about happen on this day. The requirement that it be one less than a multiple of 4 is because an auction happened on the previous day. So, this equation only works for days where an auction successfully happens on that day (so it won’t work on Day 8) and where there was a successful auction the day before (so it won’t work on Day 2 because there was no auction on Day 1).
In other words, the equation only works for days 3-7.
Now, we can formally write this new equation:
Q(d) = 20⋅n(d) - 5 [equation #2] ((valid for d=3 ... 7)
Good news! We’re pretty much done turning the word problem into math equations. Now, we can just use the equations to get some answers.
Let’s plug equation #2’s values for values of Q on certain days into equation #1’s relation for quantities between days...
Q(d+1) = 4/5 ⋅ Q(d) - 1 [equation #1]
Use equation #2 to replace the Q(d+1) with “20⋅n(d+1) - 5” and Q(d) with “20⋅n(d) - 5”...
20⋅n(d+1) - 5 = 4/5 ⋅ [ 20⋅n(d) - 5 ] - 1
Multiply the 4/5 into the brackets...
20⋅n(d+1) - 5 = 16⋅n(d) - 4 - 1
We have a “-5” on both sides. So add 5 to both sides...
20⋅n(d+1) = 16⋅n(d)
Divide both sides by 20 (and a 4 factors out of the 16 and the 20 in the process)...
n(d+1) = 4/5⋅n(d)
So, what this is telling us is that, whatever the ‘n’ is for a certain day, the next day’s ‘n’ is going to be four fifths of that.
In other words...
n(4) = 4/5⋅n(3)
n(5) = 4/5⋅n(4)
n(6) = 4/5⋅n(5)
n(7) = 4/5⋅n(6)
Remember that it only works for those days because we used equation #2 which is only valid for days 3-7. But now, we can string these together to get a more-direct relation between the beginning and the end of the puzzle:
n(7) = 4/5⋅n(6) = 4/5⋅4/5⋅n(5) = 4/5⋅4/5⋅4/5⋅n(4) = 4/5⋅4/5⋅4/5⋅4/5⋅n(3)
Using the notation of 44 to represent “4 to the 4th power” and 54 to represent “5 to the 4th power”, we can re-write this equation as:
n(7) = 44 / 54 ⋅ n(3) [equation #3]
So, to get ‘n’ for Day 7, we take the ‘n’ for Day 3 and divide by 54 and multiply by 44.
Now, remember that ‘n’ always has to be an integer? If n(7) is going to be an integer, then n(3) HAS TO BE A MULTIPLE OF 54. If it weren’t, then we’d get a fraction for n(7) when we divided by 54.
So, how do we represent the fact that n(3) has to be a multiple of 54? Well, remember how we wrote Q(d) in terms of n(d)? We’re going to do that again, but we’re going to do it to n(3) this time.
n(3) = C⋅54
In other words, ‘n’ for day 3 is some integer constant, called ‘C’, multiplied by 54. This is how we ensure that n(3) is divisible by 54. We don’t know what C is. We’ll delve into that in a moment. For now, we just know that it’s an integer.
Now that we have n(3) in terms of C, we can do the same for n(7) by plugging it into equation #3...
n(7) = 44 / 55 ⋅ n(3) = 44 / 54 ⋅ C ⋅ 54
so...
n(7) = C⋅44.
So, the ‘n’ for Day 7 is just that unknown constant C, times 4 to the 4th power.
Okay, so let’s plug these numbers for n into equation #2 (the one that says: Q(d) = 20⋅n(d) - 5 ) to get the values for Q on days 3 and 7:
Q(3) = 20⋅n(3) - 5
Q(7) = 20⋅n(7) - 5
Plugging in C⋅54 and C⋅44 for n(3) and n(7), respectively, we get...
Q(3) = 20⋅C⋅54 - 5
Q(7) = 20⋅C⋅44 - 5
Because 20 is just 4⋅5, we can work those into the 54 and the 44...
Q(3) = 4⋅5⋅C⋅54 - 5
Q(7) = 4⋅5⋅C⋅44 - 5
combining terms...
Q(3) = C⋅4⋅55 - 5 [equation #3]
Q(7) = C⋅5⋅45 - 5 [equation #4]
So, now, let’s use Q(7) to find Q(8), the quantity on the 8th day. Equation #1 is what we use to find the next day’s quantity...
Q(d+1) = 4/5 ⋅ Q(d) - 1
so...
Q(8) = 4/5 ⋅ Q(7) - 1
plugging in equation #4, our Q(7) in terms of C, we get...
Q(8) = 4/5 ⋅ [ C⋅5⋅45 - 5 ] - 1
We then multiply the 4/5 inside the brackets to get...
Q(8) = C⋅4⋅45 - 4 - 1
which reduces to...
Q(8) = C⋅46 - 5
Now, we still don’t know what C is. But here’s the important thing to note from this. The puzzle states that the importer was not able to auction off one fifth of his stock on Day 8. So that means that Q(8) MUST NOT BE DIVISIBLE BY 5. That means that C⋅46 - 5 must not be divisible by 5. Well C⋅46 - 5 won’t be divisible by 5 if C⋅46 isn’t divisible by 5 (in other words, the “- 5” at the end doesn’t affect the divisibility by 5).
Okay, so C⋅46 mustn’t be divisible by 5. Well, the 46 isn’t, so that’s not a problem. So, as long as the C isn’t, either, then we’re okay. So...
C MUST NOT BE A MULTIPLE OF 5
That’s the mathematical consequence of the part of the puzzle which says that, on Day 8, he couldn’t do the auction. If C were a multiple of 5, he’d be able to do another auction on Day 8. So, what can C be? It can be 1, 2, 3, 4, 6, 7, 8, 9, 11... (note, it can't be 0 because 0 is divisible by 5, right? You can divide 0 by 5 and get an integer back, which is the criteria we're using for "divisible").
Okay... last step. We’re going to use equation #3 and equation #1 together. Remember, equation #3 gives us Q(3) in terms of our constant C:
Q(3) = C⋅4⋅55 - 5
and equation #1 gives us the relationship between the before-auction quantities on adjacent days:
Q(d+1) = 4/5 ⋅ Q(d) - 1
In this case, we want to use if for days 2 and 3, so...
Q(3) = 4/5 ⋅ Q(2) - 1
We want to get Q(2) all by itself, so we can add 1 to both sides and then multiply by 5/4 to get:
Q(2) = 5/4 ⋅ [ Q(3) + 1 ]
Plugging in Q(3) = C⋅4⋅55 - 5, we get:
Q(2) = 5/4 ⋅ [ C⋅4⋅55 - 5 + 1 ]
or...
Q(2) = 5/4 ⋅ [ C⋅4⋅55 - 4 ]
and multiplying the 5/4 into the brackets gives...
Q(2) = C⋅56 - 5
So, according to this, any integer will work for C (as long as it’s not a multiple of 5, or we’ll be able to have an auction on day 8, remember?). So, if we want to know the smallest quantity which will work, we use C=1, to get:
Q(2) = 56 - 5
so
Q(2) = 15,620
Now, because he drank a single bottle on Day 1, we just add that bottle back to get from Day 2 to Day 1:
Q(1) = 15,621
So, that’s your answer: 15,621.
But it turns out that other integer values for C (as long as they’re not multiples of 5) will work. So, other workable quantities are: 31,246 46,871 62,496 93,746 109,371...
ADDENDUM
So, now that we’ve solved it, let’s look at why the problem works.
Note that, on Day 2, the quantity is:
Q(2) = 56 - 5
Notice that both terms (the 56 and the -5) are both divisible by 5. So, when we keep four fifths of that quantity, we get
4⋅55 - 4
The first term is still divisible by 5 (because it has a 55 in it). But the -4 term is not divisible by 5. However, the wine importer drinks a single bottle. That “resets” that -4 term back to -5, so that it’s divisible by 5 again. So we have:
Q(3) = 4⋅55 - 5
Both of those terms are divisible by 5 again, so we multiply by four fifths to get:
42⋅54 - 4
Again, the first term is divisible by 5 (because it has the 54 term), but the -4 term is not. But the importer, again, drinks a single bottle and “resets” that -4 back to -5, so we get:
Q(4) = 42⋅54 - 5
So, hopefully, by now, you can see the pattern. Each day, one of the 5’s in the first term gets turned into a 4, and the drinking of a single bottle turns the -4 term at the end back into a -5 so that we’re ready for another auction, until we run out of 5’s in the first term. So, because we started off with 56 in the first term, we can have six auctions: on days 2 through 7.
Now that we see how the drinking of a bottle “resets” the last term back to something divisible by 5, we can actually make the problem fairly generic.
Instead of saying that the next day’s quantity is 4/5 of the previous day minus one...
Q(d+1) = 4/5 ⋅ Q(d) - 1
… we can actually decide to keep any fraction so long as we drink a special number of bottles after each auction:
Q(d+1) = a/b ⋅ Q(d) - [b-a]
For a problem like this, the correct answer for Q would be...
Q(2) = b6 - b
So, when we combine those two equations, we get:
Q(3) = a/b ⋅ [ b6 - b ] - [b-a]
or...
Q(3) = a⋅b5 - a - [b-a]
or
Q(3) = a⋅b5 - b
See how Q(3) is divisible by ‘b’ (like it will need to be if we are to keep a/b of our stock in the next auction) again? So, the only result of each day is that one ‘b’ gets turned into an ‘a’. So, now we can make this puzzle any way we want, as long as we make sure that the importer keeps a/b of his stock after each auction and then drinks ‘b-a’ bottles.
For example, let’s say that a=5 and b=11. Then we can say that, every day, he auctions off 6/11 of his stock (which means that he keeps 5/11 of it) and then drinks 6 bottles. In that case, the number he starts with on Day 2 would be b6 - b, or 116 - 1 = 1,771,550.
And, to make it even more generic, you can fiddle with the number of days that you want him to be able to do his auctions. Just replace the 6th power with some variable like c.
So, if Q(2) = bc - b
Then he’ll be able to go through ‘c’ auctions before he’s no longer able to auction any more.
Now, let's define some terms.
Let's call the quantity of bottles immediately before each auction to be Q.
And, let's keep track of the quantities on each day with the notation Q(d), where 'd' is the number of the day. So, for example, Q(3) is the number of bottles he has in stock before the auction on day 3.
Next, let's formalize some of the details of the puzzle in terms of math equations.
- On each day, he sells 1/5 of the quantity and then drinks one more bottle. So, the next day (d+1), he retains 4/5 of his "day 'd'" stock, minus one:
Q(d+1) = 4/5 ⋅ Q(d) - 1 [equation #1] (valid for d=2 ... 7)
the equation is only valid when d is the day of an auction (which is why it doesn't apply to d=1). So, an example, Q(7) = 4/5 ⋅ Q(6) - 1. In other words, the “Day 7” quantity is four fifths of the Day 6 quantity, minus one.
Now, we have to put the equation aside for a moment and think about how some of these numbers have to be related to each other.
Because he sells off 1/5 of his stock in each auction, the before-auction quantity (Q) must be an integer multiple of 5. (If it weren’t, then, when we divided it by 5, we’d get a fraction). What do the integer multiples of 5 look like? They're 5, 10, 15, 20, 25, 30, etc... See how the last digit is always 0 or 5?
Now consider what the quantities immediate after the auction look like (ie, before he drinks a celebratory bottle). Because he sold off 1/5 of his stock, he has 4/5 of it left. So, immediately after an auction, he has 4/5⋅Q. This means that the AFTER AUCTION QUANTITY MUST BE A MULTIPLE OF 4. (If you’re having trouble seeing why this is so, note that this is because multiplying something by 4/5 is the same as dividing by 5 and then multiplying by 4. Because we’ve decided that the before-auction quantity must be a multiple of 5, then we must still have an integer after we divide by 5 and before we multiply by 4. So, after we multiply by 4, we’ll have a multiple of 4). What do the multiples of 4 look like? They look like 4, 8, 12, 16, 20, 24, 28, 32... etc. The important thing to note is that the last digit is always 0, 4, 8, 2, or 6.
Okay, so before each auction, he must have a quantity ending in 0 or 5. After each auction, he must have a quantity ending in 0, 4, 8, 2, or 6.
Now, after each auction, he drinks a single bottle, and then he's ready for the next auction.
I'll restate it with the mathematical implications: After each auction (ie, he has a quantity ending in 0, 4, 8, 2, or 6), he drinks a bottle (ie, he subtracts 1 from the quantity), and then he's ready for the next auction (ie, he has a quantity ending in 0 or 5)
Now, I’ll list only the mathematical implications: He has a quantity ending in either 0, 4, 8, 2, or 6. Then he subtracts 1. Then he has a quantity ending in either 0 or 5.
Ponder. That. For. A. Moment.
See it? There’s only one pair of quantities which will work. It only works if the after-auction quantity ends in 6, then he drinks a bottle, and then he has a quantity ending in 5. It doesn’t work for any other pairs of ending digits.
Okay, so we need multiples of 4 that end with the number 6 which are one higher than multiples of 5 which end in 5.
Those turn out to be:
16 - 1 = 15
36 - 1 = 35
56 - 1 = 55
76 - 1 = 75
…
So, now we have further constrained what the values of Q can be. The before auction quantities must come from the series: 15, 35, 55, 75, 95, etc.
It would be nice if we had an equation which gave us those numbers. Well, notice how the numbers are increasing by 20 each time? So, we could write something like:
Q = 20⋅n - 5
where n is 1, 2, 3, 4, etc. If you plug in those numbers for n, then you’ll see that the equation gives 15, 35, 55, etc.
Now, because each day has a different quantity, then there will be a different n which we’d plug into our new equation to get that quantity. So, just like we keep track of each day’s quantity with Q(d), we’ll need to keep track of each day’s ‘n’ with n(d).
Lastly (and this is really important), this equation doesn’t apply to all of the days. Remember that this equation gives multiples of 5 which are 1 less than some other multiple of 4. The requirement that it is a multiple of 5 is because an auction is about happen on this day. The requirement that it be one less than a multiple of 4 is because an auction happened on the previous day. So, this equation only works for days where an auction successfully happens on that day (so it won’t work on Day 8) and where there was a successful auction the day before (so it won’t work on Day 2 because there was no auction on Day 1).
In other words, the equation only works for days 3-7.
Now, we can formally write this new equation:
Q(d) = 20⋅n(d) - 5 [equation #2] ((valid for d=3 ... 7)
Good news! We’re pretty much done turning the word problem into math equations. Now, we can just use the equations to get some answers.
Let’s plug equation #2’s values for values of Q on certain days into equation #1’s relation for quantities between days...
Q(d+1) = 4/5 ⋅ Q(d) - 1 [equation #1]
Use equation #2 to replace the Q(d+1) with “20⋅n(d+1) - 5” and Q(d) with “20⋅n(d) - 5”...
20⋅n(d+1) - 5 = 4/5 ⋅ [ 20⋅n(d) - 5 ] - 1
Multiply the 4/5 into the brackets...
20⋅n(d+1) - 5 = 16⋅n(d) - 4 - 1
We have a “-5” on both sides. So add 5 to both sides...
20⋅n(d+1) = 16⋅n(d)
Divide both sides by 20 (and a 4 factors out of the 16 and the 20 in the process)...
n(d+1) = 4/5⋅n(d)
So, what this is telling us is that, whatever the ‘n’ is for a certain day, the next day’s ‘n’ is going to be four fifths of that.
In other words...
n(4) = 4/5⋅n(3)
n(5) = 4/5⋅n(4)
n(6) = 4/5⋅n(5)
n(7) = 4/5⋅n(6)
Remember that it only works for those days because we used equation #2 which is only valid for days 3-7. But now, we can string these together to get a more-direct relation between the beginning and the end of the puzzle:
n(7) = 4/5⋅n(6) = 4/5⋅4/5⋅n(5) = 4/5⋅4/5⋅4/5⋅n(4) = 4/5⋅4/5⋅4/5⋅4/5⋅n(3)
Using the notation of 44 to represent “4 to the 4th power” and 54 to represent “5 to the 4th power”, we can re-write this equation as:
n(7) = 44 / 54 ⋅ n(3) [equation #3]
So, to get ‘n’ for Day 7, we take the ‘n’ for Day 3 and divide by 54 and multiply by 44.
Now, remember that ‘n’ always has to be an integer? If n(7) is going to be an integer, then n(3) HAS TO BE A MULTIPLE OF 54. If it weren’t, then we’d get a fraction for n(7) when we divided by 54.
So, how do we represent the fact that n(3) has to be a multiple of 54? Well, remember how we wrote Q(d) in terms of n(d)? We’re going to do that again, but we’re going to do it to n(3) this time.
n(3) = C⋅54
In other words, ‘n’ for day 3 is some integer constant, called ‘C’, multiplied by 54. This is how we ensure that n(3) is divisible by 54. We don’t know what C is. We’ll delve into that in a moment. For now, we just know that it’s an integer.
Now that we have n(3) in terms of C, we can do the same for n(7) by plugging it into equation #3...
n(7) = 44 / 55 ⋅ n(3) = 44 / 54 ⋅ C ⋅ 54
so...
n(7) = C⋅44.
So, the ‘n’ for Day 7 is just that unknown constant C, times 4 to the 4th power.
Okay, so let’s plug these numbers for n into equation #2 (the one that says: Q(d) = 20⋅n(d) - 5 ) to get the values for Q on days 3 and 7:
Q(3) = 20⋅n(3) - 5
Q(7) = 20⋅n(7) - 5
Plugging in C⋅54 and C⋅44 for n(3) and n(7), respectively, we get...
Q(3) = 20⋅C⋅54 - 5
Q(7) = 20⋅C⋅44 - 5
Because 20 is just 4⋅5, we can work those into the 54 and the 44...
Q(3) = 4⋅5⋅C⋅54 - 5
Q(7) = 4⋅5⋅C⋅44 - 5
combining terms...
Q(3) = C⋅4⋅55 - 5 [equation #3]
Q(7) = C⋅5⋅45 - 5 [equation #4]
So, now, let’s use Q(7) to find Q(8), the quantity on the 8th day. Equation #1 is what we use to find the next day’s quantity...
Q(d+1) = 4/5 ⋅ Q(d) - 1
so...
Q(8) = 4/5 ⋅ Q(7) - 1
plugging in equation #4, our Q(7) in terms of C, we get...
Q(8) = 4/5 ⋅ [ C⋅5⋅45 - 5 ] - 1
We then multiply the 4/5 inside the brackets to get...
Q(8) = C⋅4⋅45 - 4 - 1
which reduces to...
Q(8) = C⋅46 - 5
Now, we still don’t know what C is. But here’s the important thing to note from this. The puzzle states that the importer was not able to auction off one fifth of his stock on Day 8. So that means that Q(8) MUST NOT BE DIVISIBLE BY 5. That means that C⋅46 - 5 must not be divisible by 5. Well C⋅46 - 5 won’t be divisible by 5 if C⋅46 isn’t divisible by 5 (in other words, the “- 5” at the end doesn’t affect the divisibility by 5).
Okay, so C⋅46 mustn’t be divisible by 5. Well, the 46 isn’t, so that’s not a problem. So, as long as the C isn’t, either, then we’re okay. So...
C MUST NOT BE A MULTIPLE OF 5
That’s the mathematical consequence of the part of the puzzle which says that, on Day 8, he couldn’t do the auction. If C were a multiple of 5, he’d be able to do another auction on Day 8. So, what can C be? It can be 1, 2, 3, 4, 6, 7, 8, 9, 11... (note, it can't be 0 because 0 is divisible by 5, right? You can divide 0 by 5 and get an integer back, which is the criteria we're using for "divisible").
Okay... last step. We’re going to use equation #3 and equation #1 together. Remember, equation #3 gives us Q(3) in terms of our constant C:
Q(3) = C⋅4⋅55 - 5
and equation #1 gives us the relationship between the before-auction quantities on adjacent days:
Q(d+1) = 4/5 ⋅ Q(d) - 1
In this case, we want to use if for days 2 and 3, so...
Q(3) = 4/5 ⋅ Q(2) - 1
We want to get Q(2) all by itself, so we can add 1 to both sides and then multiply by 5/4 to get:
Q(2) = 5/4 ⋅ [ Q(3) + 1 ]
Plugging in Q(3) = C⋅4⋅55 - 5, we get:
Q(2) = 5/4 ⋅ [ C⋅4⋅55 - 5 + 1 ]
or...
Q(2) = 5/4 ⋅ [ C⋅4⋅55 - 4 ]
and multiplying the 5/4 into the brackets gives...
Q(2) = C⋅56 - 5
So, according to this, any integer will work for C (as long as it’s not a multiple of 5, or we’ll be able to have an auction on day 8, remember?). So, if we want to know the smallest quantity which will work, we use C=1, to get:
Q(2) = 56 - 5
so
Q(2) = 15,620
Now, because he drank a single bottle on Day 1, we just add that bottle back to get from Day 2 to Day 1:
Q(1) = 15,621
So, that’s your answer: 15,621.
But it turns out that other integer values for C (as long as they’re not multiples of 5) will work. So, other workable quantities are: 31,246 46,871 62,496 93,746 109,371...
ADDENDUM
So, now that we’ve solved it, let’s look at why the problem works.
Note that, on Day 2, the quantity is:
Q(2) = 56 - 5
Notice that both terms (the 56 and the -5) are both divisible by 5. So, when we keep four fifths of that quantity, we get
4⋅55 - 4
The first term is still divisible by 5 (because it has a 55 in it). But the -4 term is not divisible by 5. However, the wine importer drinks a single bottle. That “resets” that -4 term back to -5, so that it’s divisible by 5 again. So we have:
Q(3) = 4⋅55 - 5
Both of those terms are divisible by 5 again, so we multiply by four fifths to get:
42⋅54 - 4
Again, the first term is divisible by 5 (because it has the 54 term), but the -4 term is not. But the importer, again, drinks a single bottle and “resets” that -4 back to -5, so we get:
Q(4) = 42⋅54 - 5
So, hopefully, by now, you can see the pattern. Each day, one of the 5’s in the first term gets turned into a 4, and the drinking of a single bottle turns the -4 term at the end back into a -5 so that we’re ready for another auction, until we run out of 5’s in the first term. So, because we started off with 56 in the first term, we can have six auctions: on days 2 through 7.
Now that we see how the drinking of a bottle “resets” the last term back to something divisible by 5, we can actually make the problem fairly generic.
Instead of saying that the next day’s quantity is 4/5 of the previous day minus one...
Q(d+1) = 4/5 ⋅ Q(d) - 1
… we can actually decide to keep any fraction so long as we drink a special number of bottles after each auction:
Q(d+1) = a/b ⋅ Q(d) - [b-a]
For a problem like this, the correct answer for Q would be...
Q(2) = b6 - b
So, when we combine those two equations, we get:
Q(3) = a/b ⋅ [ b6 - b ] - [b-a]
or...
Q(3) = a⋅b5 - a - [b-a]
or
Q(3) = a⋅b5 - b
See how Q(3) is divisible by ‘b’ (like it will need to be if we are to keep a/b of our stock in the next auction) again? So, the only result of each day is that one ‘b’ gets turned into an ‘a’. So, now we can make this puzzle any way we want, as long as we make sure that the importer keeps a/b of his stock after each auction and then drinks ‘b-a’ bottles.
For example, let’s say that a=5 and b=11. Then we can say that, every day, he auctions off 6/11 of his stock (which means that he keeps 5/11 of it) and then drinks 6 bottles. In that case, the number he starts with on Day 2 would be b6 - b, or 116 - 1 = 1,771,550.
And, to make it even more generic, you can fiddle with the number of days that you want him to be able to do his auctions. Just replace the 6th power with some variable like c.
So, if Q(2) = bc - b
Then he’ll be able to go through ‘c’ auctions before he’s no longer able to auction any more.