0%

Problem 278


Problem 278


Linear Combinations of Semiprimes

Given the values of integers 1 < a1 < a2 <… < an, consider the linear combination q1a1 + q2a2 + … + qnan = b, using only integer values qk ≥ 0.

Note that for a given set of ak, it may be that not all values of b are possible.
For instance, if a1 = 5 and a2 = 7, there are no q1 ≥ 0 and q2 ≥ 0 such that b could be 1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18 or 23.
In fact, 23 is the largest impossible value of b for a1 = 5 and a2 = 7.
We therefore call f(5, 7) = 23.
Similarly, it can be shown that f(6, 10, 15)=29 and f(14, 22, 77) = 195.

Find ∑ f(p*q,p*r,q*r), where p, q and r are prime numbers and p < q < r < 5000.


半素数线性组合

给定整数1 < a1 < a2 <… < an,考虑其线性组合q1a1 + q2a2 + … + qnan = b,其中qk ≥ 0均为整数。

注意到,对于特定集合ak,不是所有的b值都能取到。
例如,如果a1 = 5且a2 = 7,不存在q1 ≥ 0和q2 ≥ 0使得b取1、2、3、4、6、8、9、11、13、16、18或23。
事实上,当a1 = 5且a2 = 7时,不能取得的b值最大为23。
我们因此记f(5, 7) = 23。
类似地可以得出f(6, 10, 15)=29以及f(14, 22, 77) = 195。

对于所有素数p < q < r < 5000,求∑ f(p*q,p*r,q*r)。