Problem 69 » 履歴 » バージョン 1
Noppi, 2024/01/30 11:21
| 1 | 1 | Noppi | [ホーム](https://redmine.noppi.jp) - [[Wiki|Project Euler]] |
|---|---|---|---|
| 2 | # [[Problem 69]] |
||
| 3 | |||
| 4 | ## Totient Maximum |
||
| 5 | Euler's totient function, $\phi(n)$ [sometimes called the phi function], is defined as the number of positive integers not exceeding $n$ which are relatively prime to $n$. For example, as $1$, $2$, $4$, $5$, $7$, and $8$, are all less than or equal to nine and relatively prime to nine, $\phi(9)=6$. |
||
| 6 | |||
| 7 | | **$n$** | **Relatively Prime** | **$\phi(n)$** | **$n/\phi(n)$** | |
||
| 8 | |--|--|--|--| |
||
| 9 | | 2 | 1 | 1 | 2 | |
||
| 10 | | 3 | 1,2 | 2 | 1.5 | |
||
| 11 | | 4 | 1,3 | 2 | 2 | |
||
| 12 | | 5 | 1,2,3,4 | 4 | 1.25 | |
||
| 13 | | 6 | 1,5 | 2 | 3 | |
||
| 14 | | 7 | 1,2,3,4,5,6 | 6 | 1.1666... | |
||
| 15 | | 8 | 1,3,5,7 | 4 | 2 | |
||
| 16 | | 9 | 1,2,4,5,7,8 | 6 | 1.5 | |
||
| 17 | | 10 | 1,3,7,9 | 4 | 2.5 | |
||
| 18 | |||
| 19 | It can be seen that $n = 6$ produces a maximum $n/\phi(n)$ for $n\leq 10$. |
||
| 20 | |||
| 21 | Find the value of $n\leq 1\,000\,000$ for which $n/\phi(n)$ is a maximum. |
||
| 22 | |||
| 23 | ## トーティエント関数の最大値 |
||
| 24 | オイラーのトーティエント関数, φ(n) [時々ファイ関数とも呼ばれる]は, n と互いに素な n 未満の数の数を定める. たとえば, 1, 2, 4, 5, 7, そして8はみな9未満で9と互いに素であり, φ(9)=6. |
||
| 25 | |||
| 26 | | n | 互いに素な数 | φ(n) | n/φ(n) | |
||
| 27 | |--|--|--|--| |
||
| 28 | | 2 | 1 | 1 | 2 | |
||
| 29 | | 3 | 1,2 | 2 | 1.5 | |
||
| 30 | | 4 | 1,3 | 2 | 2 | |
||
| 31 | | 5 | 1,2,3,4 | 4 | 1.25 | |
||
| 32 | | 6 | 1,5 | 2 | 3 | |
||
| 33 | | 7 | 1,2,3,4,5,6 | 6 | 1.1666... | |
||
| 34 | | 8 | 1,3,5,7 | 4 | 2 | |
||
| 35 | | 9 | 1,2,4,5,7,8 | 6 | 1.5 | |
||
| 36 | | 10 | 1,3,7,9 | 4 | 2.5 | |
||
| 37 | |||
| 38 | n ≤ 10 では n/φ(n) の最大値は n=6 であることがわかる. |
||
| 39 | |||
| 40 | n ≤ 1,000,000で n/φ(n) が最大となる値を見つけよ. |
||
| 41 | |||
| 42 | ```scheme |
||
| 43 | ``` |