Problem 934
Unlucky Primes
We define the unlucky prime of a number $n$, denoted $u(n)$, as the smallest prime number $p$ such that the remainder of $n$ divided by $p$ (i.e. $n \bmod p$) is not a multiple of seven.
For example, $u(14) = 3$, $u(147) = 2$ and $u(1470) = 13$.
Let $U(N)$ be the sum $\sum_{n = 1}^N u(n)$.
You are given $U(1470) = 4293$.
Find $U(10^{17})$.
不幸素数
定义数$n$对应的不幸素数$u(n)$为最小的、使得$n$除以$p$的余数(即$n \bmod p$)不是$7$的倍数的素数$p$。
例如,$u(14) = 3$,$u(147) = 2$,$u(1470) = 13$。
记$U(N)$为求和$\sum_{n = 1}^N u(n)$。
已知$U(1470) = 4293$。
求$U(10^{17})$。