Free Chocolates

Logic Level 2

A shopkeeper has an excellent recycling policy:

  1. He gives you 1 chocolate per every Dollar you give him.
  2. He gives you 1 chocolate per every 3 wrappers you give him.

You have $59049 with you. What is the maximum number of chocolates that you can buy?

Extra Credit: Try to derive a generalized expression for the number of chocolates you can buy with $n.

Details and Assumptions:

  1. You do not initially have any wrappers with you.
  2. All the chocolates you buy come wrapped in wrappers.
  3. There is no upper bound on the number of transactions you can do.
  4. The shopkeeper has infinite chocolates.
This problem is inspired by @Writo.

Problem Loading...

Note Loading...

Set Loading...