0%

Problem 839


Problem 839


Beans in Bowls

The sequence Sn is defined by S0=290797 and Sn=Sn12mod50515093 for n>0.

There are N bowls indexed 0,1,,N1. Initially there are Sn beans in bowl n.

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

Let B(N) be the number of steps needed to sort the bowls into non-descending order.

For example, B(5)=0, B(6)=14263289 and B(100)=3284417556.

Find B(107).


碗中豆

序列Sn按如下方式定义:S0=290797;对于n>0Sn=Sn12mod50515093

N个碗,其编号分别为0,1,,N1。一开始,编号为n的碗中放有Sn颗豆子。

接下来的每一步中,先选择编号最小的、豆子数目比后一个碗严格更多的碗n,再从碗n中移动一颗豆子到碗n+1

B(N)为将碗中豆子数目调整为非递降序列所需的步数。

例如,B(5)=0B(6)=14263289B(100)=3284417556

B(107)


Gitalking ...