Problem 21 » 履歴 » バージョン 1
Noppi, 2024/01/03 13:45
1 | 1 | Noppi | [ホーム](https://redmine.noppi.jp) - [[Wiki|Project Euler]] |
---|---|---|---|
2 | # [[Problem 21]] |
||
3 | |||
4 | ## Amicable Numbers |
||
5 | Let $d(n)$ be defined as the sum of proper divisors of $n$ (numbers less than $n$ which divide evenly into $n$). |
||
6 | If $d(a) = b$ and $d(b) = a$, where $a \ne b$, then $a$ and $b$ are an amicable pair and each of $a$ and $b$ are called amicable numbers. |
||
7 | 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$. |
||
8 | Evaluate the sum of all the amicable numbers under $10000$. |
||
9 | |||
10 | ## 友愛数 |
||
11 | d(n) を n の真の約数の和と定義する. (真の約数とは n 以外の約数のことである. ) |
||
12 | もし, d(a) = b かつ d(b) = a (a ≠ b のとき) を満たすとき, a と b は友愛数(親和数)であるという. |
||
13 | |||
14 | 例えば, 220 の約数は 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110 なので d(220) = 284 である. |
||
15 | また, 284 の約数は 1, 2, 4, 71, 142 なので d(284) = 220 である. |
||
16 | |||
17 | それでは10000未満の友愛数の和を求めよ. |
||
18 | |||
19 | ```scheme |
||
20 | ``` |