0%

Problem 593


Problem 593


Fleeting Medians

We define two sequences S=S(1),S(2),,S(n) and S2=S2(1),S2(2),,S2(n):

S(k)=(pk)k mod 10007 where pk is the kth prime number.

S2(k)=S(k)+S(k10000+1) where denotes the floor function.

Then let M(i,j) be the median of elements S2(i) through S2(j), inclusive. For example, M(1,10)=2021.5 and M(102,103)=4715.0.

Let F(n,k)=i=1nk+1M(i,i+k1). For example, F(100,10)=463628.5 and F(105,104)=675348207.5.

Find F(107,105). If the sum is not an integer, use .5 to denote a half. Otherwise, use .0 instead.


快速中位数

我们定义两个序列S=S(1),S(2),,S(n)S2=S2(1),S2(2),,S2(n)

S(k)=(pk)k mod 10007,其中pk是第k个素数。

S2(k)=S(k)+S(k10000+1),其中表示下取整函数。

然后记M(i,j)为从S2(i)S2(j)(含)的中位数。例如,M(1,10)=2021.5,而M(102,103)=4715.0

F(n,k)=i=1nk+1M(i,i+k1)。例如,F(100,10)=463628.5,而F(105,104)=675348207.5

F(107,105)。如果这个和值不是整数,用.5表示,否则用.0表示。


Gitalking ...