chore(i8n,learn): processed translations
This commit is contained in:
committed by
Mrugesh Mohapatra
parent
15047f2d90
commit
e5c44a3ae5
@ -1,36 +1,48 @@
|
||||
---
|
||||
id: 5900f3811000cf542c50fe94
|
||||
title: 问题21:友好的数字
|
||||
title: 'Problem 21: Amicable numbers'
|
||||
challengeType: 5
|
||||
videoUrl: ''
|
||||
forumTopicId: 301851
|
||||
dashedName: problem-21-amicable-numbers
|
||||
---
|
||||
|
||||
# --description--
|
||||
|
||||
设d( `n` )定义为`n`的适当除数之`和` (小于`n的`数均匀分成`n` )。如果d( `a` )= `b`并且d( `b` )= `a` ,其中`a` ≠ `b` ,则`a`和`b`是友好对,并且`a`和`b`中的每`一个`被称为友好数字。例如,220的适当除数是1,2,4,5,10,11,20,22,44,55和110;因此d(220)= 284. 284的适当除数是1,2,4,71和142;所以d(284)= 220.评估`n`下所有友好数字的总和。
|
||||
Let d(`n`) be defined as the sum of proper divisors of `n` (numbers less than `n` which divide evenly into `n`).
|
||||
|
||||
If d(`a`) = `b` and d(`b`) = `a`, where `a` ≠ `b`, then `a` and `b` are an amicable pair and each of `a` and `b` are called amicable numbers.
|
||||
|
||||
For example, the proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110; therefore d(220) = 284. The proper divisors of 284 are 1, 2, 4, 71 and 142; so d(284) = 220.
|
||||
|
||||
Evaluate the sum of all the amicable numbers under `n`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`sumAmicableNum(1000)`应返回504。
|
||||
`sumAmicableNum(1000)` should return a number.
|
||||
|
||||
```js
|
||||
assert(typeof sumAmicableNum(1000) === 'number');
|
||||
```
|
||||
|
||||
`sumAmicableNum(1000)` should return 504.
|
||||
|
||||
```js
|
||||
assert.strictEqual(sumAmicableNum(1000), 504);
|
||||
```
|
||||
|
||||
`sumAmicableNum(2000)`应该返回2898。
|
||||
`sumAmicableNum(2000)` should return 2898.
|
||||
|
||||
```js
|
||||
assert.strictEqual(sumAmicableNum(2000), 2898);
|
||||
```
|
||||
|
||||
`sumAmicableNum(5000)`应该返回8442。
|
||||
`sumAmicableNum(5000)` should return 8442.
|
||||
|
||||
```js
|
||||
assert.strictEqual(sumAmicableNum(5000), 8442);
|
||||
```
|
||||
|
||||
`sumAmicableNum(10000)`应返回31626。
|
||||
`sumAmicableNum(10000)` should return 31626.
|
||||
|
||||
```js
|
||||
assert.strictEqual(sumAmicableNum(10000), 31626);
|
||||
|
Reference in New Issue
Block a user