All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Chairs galore (Posted on 2014-10-31)
A famous furniture store staged a big sale of chairs which attracted numerous customers.
The 1st customer bought 2 chairs plus a half of the remaining chairs.
The 2nd customer bought 3 chairs plus a third of the remaining chairs.
The 3rd customer bought 4 chairs plus a quarter of the remaining chairs
... etc till it was impossible to proceed in the said manner.
How many customers could be accommodated and how many chairs were sold to them?

 No Solution Yet Submitted by Ady TZIDON No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 solution and discussion | Comment 3 of 4 |
It's to be assumed that indeed at least 3 customers were served.

Let n be the number of chairs in stock at the beginning.

After the first customer left, (n-2)/2 chairs were left.
After the second customer left, (n-8)/3 chairs were left.
After the third customer left, (n-20)/4 chairs were left.
After the fourth customer would have left, (n-40)/5 chairs would have been left.
After the fifth customer would have left, (n-70)/6 chairs would have been left.

The first formula above requires n to be even.
The second requires n to be 2 more than a multiple of 3.
The third requires n to be a multiple of 4.
The fourth requires n to be a multiple of 5.

The fifth would require n to be 4 more than a multiple of 6 and therefore 1 more than a multiple of 3, which is incompatible with the remaining chairs after customer 2.

Therefore only 3 or 4 customers were accommodated.

Depending on the exact numbers of chairs originally in stock, differing numbers of chairs had been sold:

` n     customers   chairs sold  20       3           20 32       3           29 44       3           38 56       3           47 68       3           56 80       4           72 92       3           74104       3           83116       3           92128       3          101140       4          120152       3          119164       3          128176       3          137188       3          146200       4          168212       3          164224       3          173236       3          182248       3          191260       4          216272       3          209284       3          218296       3          227308       3          236320       4          264332       3          254344       3          263356       3          272368       3          281380       4          312392       3          299404       3          308416       3          317428       3          326440       4          360452       3          344464       3          353476       3          362488       3          371500       4          408`

For n = 8 To 500 Step 12
remain = n
For cust = 1 To 10000
saveremain = remain
remain = remain - (cust + 1)
If remain Mod (cust + 1) = 0 And remain >= 0 Then
remain = remain - remain / (cust + 1)
Else
Exit For
End If
Next cust
If cust - 1 >= 3 Then
Text1.Text = Text1.Text & mform(n, "###") & mform(cust - 1, "#######0") & mform(n - saveremain, "############0") & crlf
DoEvents
End If
Next

 Posted by Charlie on 2014-10-31 10:19:44

 Search: Search body:
Forums (0)