2018-10-10 22:03:03 +00:00
|
|
|
|
---
|
|
|
|
|
id: 5900f4c81000cf542c50ffd9
|
2020-12-16 07:37:30 +00:00
|
|
|
|
title: 问题347:最大整数可被两个素数整除
|
2018-10-10 22:03:03 +00:00
|
|
|
|
challengeType: 5
|
|
|
|
|
videoUrl: ''
|
|
|
|
|
---
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --description--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
只能被素数2和3整除的最大整数≤100是96,因为96 = 32 \* 3 = 25 \* 3。对于两个不同的素数p和q,令M(p,q,N)是最大的正整数≤N,只能被p和q整除,并且如果不存在这样的正整数,则M(p,q,N)= 0。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
例如M(2,3,100)= 96。 M(3,5,100)= 75而不是90因为90可以被2,3和5整除。另外M(2,73,100)= 0因为不存在可以被2和73整除的正整数≤100。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
设S(N)为所有不同M(p,q,N)的和。 S(100)= 2262。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
找到S(10 000 000)。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --hints--
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
`euler347()`应该返回11109800204052。
|
2018-10-10 22:03:03 +00:00
|
|
|
|
|
|
|
|
|
```js
|
2020-12-16 07:37:30 +00:00
|
|
|
|
assert.strictEqual(euler347(), 11109800204052);
|
2018-10-10 22:03:03 +00:00
|
|
|
|
```
|
|
|
|
|
|
2020-12-16 07:37:30 +00:00
|
|
|
|
# --solutions--
|
2020-08-13 15:24:35 +00:00
|
|
|
|
|