`

Project Euler 第37题

阅读更多
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.

Find the sum of the only eleven primes that are both truncatable from left to right and right to left.

NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes.

3797是一个奇特的素数,依次从左到右去掉一个数字,得到的数字仍然为素数,同样从右到左,也会素数。一共有11个这样的素数,求他们的和。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics