Problem 37 » 履歴 » バージョン 1
Noppi, 2024/01/14 12:55
1 | 1 | Noppi | [ホーム](https://redmine.noppi.jp) - [[Wiki|Project Euler]] |
---|---|---|---|
2 | # [[Problem 37]] |
||
3 | |||
4 | ## Truncatable Primes |
||
5 | The number $3797$ has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: $3797$, $797$, $97$, and $7$. Similarly we can work from right to left: $3797$, $379$, $37$, and $3$. |
||
6 | |||
7 | Find the sum of the only eleven primes that are both truncatable from left to right and right to left. |
||
8 | |||
9 | NOTE: $2$, $3$, $5$, and $7$ are not considered to be truncatable primes. |
||
10 | |||
11 | ## 切り詰め可能素数 |
||
12 | 3797は面白い性質を持っている. まずそれ自身が素数であり, 左から右に桁を除いたときに全て素数になっている (3797, 797, 97, 7). 同様に右から左に桁を除いたときも全て素数である (3797, 379, 37, 3). |
||
13 | |||
14 | 右から切り詰めても左から切り詰めても素数になるような素数は11個しかない. 総和を求めよ. |
||
15 | |||
16 | 注: 2, 3, 5, 7を切り詰め可能な素数とは考えない. |
||
17 | |||
18 | ```scheme |
||
19 | ``` |