# How much money did this donut shop owner make?

It's been a tiring day and Jack's hungry. His daughter calls him up and asks daddy to buy donuts on the way back. Instead of going to his favorite shop, Pi Donuts, Jack sees Sigma Donuts on the way instead, and decides to drop by.

'Five donuts please,' he says.

'That'll be 25 cents,' says the shopkeeper.

'Five cents per donut? That's pretty cheap,' says Jack, surprised. 'How do you even make money?'

The shopkeeper smiles. 'It's the big orders which get me the cash. The number of donuts I sell is always a one or two digit number, and besides, they're priced according to how many you buy.'

'So it would cost me differently based on how many donuts I buy?'

'Yup, it's a simple algebraic manipulation,' says the shopkeeper. 'You can do it yourself if I give you the number of donuts someone's buying. Like yesterday this woman ordered a couple dozen — actually, tell you what, I'll give 'em to you for free if you can guess what was the money I made from my biggest order yesterday. Just remember, the price per donut depends on how many donuts you buy.'

'Alright,' says Jack, thrilled.

'You have three questions.'

Jack thinks for a while.

'Is your price unique?' he asks. 'If I buy $$x$$ donuts and it costs $$y$$ per donut, then is there a unique $$x$$ for any chosen $$y$$?'

'No,' says the shopkeeper. 'A few values are unique, yes, but most aren't. The maximum number of times I use a value is ten, no more than that.'

'So the maximum number of values that $$x$$ can take for any given $$y$$ is ten?'

'Yup.'

'Makes sense,' says Jack. 'What is the number of donuts you have to sell to make the most amount of money?'

'I make the most cash when someone buys 99 donuts, as it should be. But it's not necessary that the price is in ascending order — there do exist $$x$$ such that someone buying $$x+1$$ donuts makes me less money than someone buying $$x$$ donuts.'

'That's a terrible business strategy,' points out Jack. 'Then everyone will just buy $$x+1$$ donuts instead of $$x$$.'

'Well, we make do with what we have,' says the shopkeeper. 'No one's bought 99 donuts yet.'

'Okay,' says Jack, laughing at the shopkeeper's incompetence. 'Your biggest order yesterday - how many did you sell?'

The shopkeeper laughs. 'I'm not going to tell you that! But I can tell you this - two people came into the shop yesterday, and I charged them the same per donut. What's interesting, however, is that they actually bought a different number of donuts! Plus, if a third guy had come, to get the same price per donut, he'd have to buy the same number of donuts as one of the other two.'

Jack, being a perfect logician, determines the value within a minute.

Shopkeeper: ಠ ︵ ಠ

Jack goes home and has dinner with his family, and they all enjoy the donuts.

What was the number of donuts the shopkeeper sold in his biggest order, and how much money did he make from that order?

BONUS: How does the shopkeeper determine the price per donut given the number of donuts?

• I counted five questions. And this is a "guess what I'm thinking" questions. There's not nearly enough information to come up with a unique answer. Oct 20, 2020 at 18:28

There is not a lot to go on, but it could be that the price per donut is

the sum of the digits in the number of donuts ordered.
You can have at most 10 different amounts with the same price and this occurs when you have a digit sum of 9: 9, 18, 27, 36, 45, 54, 63, 72, 81, 90.

The two who came in the day before could have bought:

1 and 10 donuts
or
89 and 98 donuts.
These are the only possibilities where a particular digit sum can be created in exactly two ways. As it has to be more than a couple of dozen (one of the other orders that occurred that day) it has to be the latter case. He will have asked 17 cents per donut, or 17*98=1666 cents, \\$16.66, in total.

• Nicely done! +1 Oct 20, 2020 at 8:34
• Why couldn't the orders yesterday be 1, 10, and 24 doughnuts, with the maximum revenue being 24×6=144? Oct 20, 2020 at 8:40
• Also, this doesn't fit the statement "A few values are unique": only one is (18). Oct 20, 2020 at 8:43
• @msh210: Yes, it is not made unambiguously clear that one of the two with the same price is the biggest order of that day, but the shopkeeper clearly does offer that information as a clue as to what his biggest order was. Oct 20, 2020 at 8:46