文章目錄

原题链接http://projecteuler.net/problem=55

Lychrel numbers

If we take 47, reverse and add, 47 + 74 = 121, which is palindromic.

Not all numbers produce palindromes so quickly. For example,

349 + 943 = 1292,
1292 + 2921 = 4213
4213 + 3124 = 7337

That is, 349 took three iterations to arrive at a palindrome.

Although no one has proved it yet, it is thought that some numbers, like 196, never produce a palindrome. A number that never forms a palindrome through the reverse and add process is called a Lychrel number. Due to the theoretical nature of these numbers, and for the purpose of this problem, we shall assume that a number is Lychrel until proven otherwise. In addition you are given that for every number below ten-thousand, it will either (i) become a palindrome in less than fifty iterations, or, (ii) no one, with all the computing power that exists, has managed so far to map it to a palindrome. In fact, 10677 is the first number to be shown to require over fifty iterations before producing a palindrome: 4668731596684224866951378664 (53 iterations, 28-digits).

Surprisingly, there are palindromic numbers that are themselves Lychrel numbers; the first example is 4994.

How many Lychrel numbers are there below ten-thousand?

NOTE: Wording was modified slightly on 24 April 2007 to emphasise the theoretical nature of Lychrel numbers.
利克瑞尔数

如果我们取47,将它逆序并求和,47 + 74 = 121,是一个回文数。
并不是所有的数都可以这么快产生回文数。例如
349 + 943 = 1292,
1292 + 2921 = 4213
4213 + 3124 = 7337
也就是说,349用了3此迭代得到一个回文数。
虽然至今没有人证明,但是有猜想认为一些数,如196,永远不产生回文数。一个数通过逆序和迭代如果永远不产生回文数则称为利克瑞尔数。因为这些数的理论本质以及方便这个问题的目的,我们假设一个数是利克瑞尔数,直到证明不是。另外,对于每个小于10000的数,给定两种可能,它或者是(i)在小于50次迭代变成循环数(ii)没有一个人,在有限的计算能力下,能够将它迭代到一个回文数。事实上,10677是第一个超过50次迭代产生回文数:4668731596684224866951378664(53次迭代,28位数)
令人惊奇的是,有一些回文数自身也是利克瑞尔数,第一个例子是4994.
求10000以下一共有多少个利克瑞尔数?
注意:为了强调利克瑞尔数的理论一些性质,一些单词于2007.4.24更改

解答:
没什么,遍历。

文章目錄