Cross a Magical Bridge Infinite Times

Calculus Level 3

You start with a positive whole number of coins. Right in front of you is a magical bridge. The toll for crossing the bridge each time is exactly 10000 10000 coins. However, after you cross the bridge but before you pay the toll, your coins are multiplied by n n , where n n is the total number of times you have crossed the bridge.

For example, if you started with 15000 15000 coins, the first time you cross the bridge and after paying the toll, you will have 5000 5000 coins left ( ( subtract 10000 10000 for the toll ) . ). Crossing the bridge for the second time and paying the toll leaves you with 0 0 ( ( double 5000 5000 then subtract 10000 10000 for the toll ) . ).

You cross the bridge infinite times and always have a positive number of coins. What is the minimum possible number of coins you can have at the start?


Inspired by the famous "A Bargain with the Devil" problem, in which your number of coins was multiplied by a fixed value before paying a fixed toll each time crossing a bridge for a fixed number of times.


The answer is 17183.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Nick Turtle
Jun 9, 2018

Suppose that the toll is t t coins and that you start with x x coins.

The first time you cross the bridge, you have x t > 0 x-t>0 coins left.

The second time, you have 2 ( x t ) t > 0 2(x-t)-t>0 coins left.

The third time, you have 3 ( 2 ( x t ) t ) t > 0 3(2(x-t)-t)-t>0 coins left.

The n n th time, you have n ( ( n 1 ) ( ( n 2 ) ( 3 ( 2 ( x t ) t ) t ) t ) t ) t > 0 n((n-1)((n-2)(\cdots 3(2(x-t)-t)-t)-t\cdots)-t)-t>0 coins left. Simplify this to get n ! x n ! t n ! 2 ! t n ! 3 ! t n ! n ! t > 0 n!\ x-n!\ t-\frac{n!}{2!}t-\frac{n!}{3!}t-\cdots-\frac{n!}{n!}t>0 . Then, solve it to get that x > t ( 1 1 ! + 1 2 ! + 1 3 ! + 1 n ! ) x>t\left(\frac{1}{1!}+\frac{1}{2!}+\frac{1}{3!}+\cdots\frac{1}{n!}\right) for all n n . Note that this is a bounded, monotonically increasing sequence.

When n n\to\infty , we find that x > t ( e 1 ) x>t(e-1) .

The minimum positive integer x x when t = 10000 t=10000 and n n\to\infty is therefore 17183 17183 coins.

Simon Ouyang
Jun 9, 2018

Javascript:

for (let init = 0;; init++) {

let coin = init

for (let n = 1; n < 100; n++) {

coin = coin * n - 10000

if (coin < 0) {

break

}

}

if (coin > 0) {

console.log(init)

break

}

}

I also have a solution use Gamma function...

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...