0%

Problem 574


Problem 574


Verifying Primes

Let q be a prime and AB>0 be two integers with the following properties:

  • A and B have no prime factor in common, that is gcd(A,B)=1.
  • The product AB is divisible by every prime less than q.

It can be shown that, given these conditions, any sum A+B<q2 and any difference 1<AB<q2 has to be a prime number. Thus you can verify that a number p is prime by showing that either p=A+B<q2 or p=AB<q2 for some A,B,q fulfilling the conditions listed above.

Let V(p) be the smallest possible value of A in any sum p=A+B and any difference p=AB, that verifies p being prime. Examples:
V(2)=1, since 2=1+1<22.
V(37)=22, since 37=22+15=211+35<72 is the associated sum with the smallest possible A.
V(151)=165 since 151=16514=351127<132 is the associated difference with the smallest possible A.

Let S(n) be the sum of V(p) for all primes p<n. For example, S(10)=10 and S(200)=7177.

Find S(3800).


检验素数

取素数q及整数AB>0满足以下性质:

  • AB没有相同的质因数,也就是说gcd(A,B)=1
  • 乘积AB能被所有小于q的素数整除。

可以证明,在上述条件下,满足A+B<q2的两数之和,以及满足1<AB<q2的两数之差,一定是素数。因此你可以寻找满足上述条件的的A,B,q,使得p能写成p=A+B<q2p=AB<q2的形式,以此来验证p是素数。

对于任意素数p,记V(P)为使得p能表达为两数之和p=A+B或两数之差p=AB的最小整数A。例如:
V(2)=1,因为2=1+1<22
V(37)=22,因为37=22+15=211+35<72能表达为两数之和且A最小。
V(151)=165,因为151=16514=351127<132能表达为两数之差且A最小。

S(n)为所有素数p<n对应的V(p)之和。例如,S(10)=10S(200)=7177

S(3800)


Gitalking ...