0%

Problem 874


Problem 874


Maximal Prime Score

Let $p(t)$ denote the $(t+1)$th prime number. So that $p(0) = 2$, $p(1) = 3$, etc.

We define the prime score of a list of nonnegative integers $[a_1, \dots, a_n]$ as the sum $\sum_{i = 1}^n p(a_i)$.

Let $M(k, n)$ be the maximal prime score among all lists $[a_1, \dots, a_n]$ such that:

  • $0 \leq a_i < k$ for each $i$;
  • the sum $\sum_{i = 1}^n a_i$ is a multiple of $k$.

For example, $M(2, 5) = 14$ as $[0, 1, 1, 1, 1]$ attains a maximal prime score of $14$.

Find $M(7000, p(7000))$.


最大质数得分

记$p(t)$为第$(t+1)$个质数,因此$p(0) = 2$,$p(1) = 3$,依此类推。

定义非负整数列$[a_1, \dots, a_n]$的质数得分为$\sum_{i = 1}^n p(a_i)$。

考虑所有满足如下条件的非负整数列$[a_1, \dots, a_n]$,记$M(k,n)$为其质数得分的最大值:

  • 对于所有$i$,$0 \leq a_i < k$;
  • 数列和$\sum_{i = 1}^n a_i$是$k$的倍数。

例如,$M(2, 5) = 14$,最大质数得分$14$在数列$[0, 1, 1, 1, 1]$时取得。

求$M(7000, p(7000))$。