839. Beans in Bowls

The sequence is defined by and for .

There are bowls indexed . Initially there are beans in bowl .

At each step, the smallest index is found such that bowl has strictly more beans than bowl . Then one bean is moved from bowl to bowl .

Let be the number of steps needed to sort the bowls into non-descending order. For example, , and .

Find .

839. 碗中豆

定义数列 满足以下递推关系: 时有

初始时有 个碗,分别标号为 。初始时 号碗里有 粒豆子。

每一步中,我们将找到最小的 ,使其满足 号碗中的豆子数量严格多于第 号碗中的豆子数。随后从 号碗中移一颗豆子到 号碗中。

为在有 个碗的情况下,将碗中的豆子数变为单调不下降序列所需的步数。已知:


这个链接 回到源站。

这个链接 回到详细版题目目录。