A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, 44 32 13 10 1 1 85 89 145 42 20 4 16 37 58 89 Therefore any chain that arrives at 1 o…
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, 44 → 32 → 13 → 10 → 1 → 1 85 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 → 89 Therefore any chain that…
题目 Square digit chains A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, 44 → 32 → 13 → 10 → 1 → 185 → 89 → 145 → 42 → 20 → 4 → 16 → 37 → 58 → 89 The…
The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145: 1! + 4! + 5! = 1 + 24 + 120 = 145 Perhaps less well known is 169, in that it produces the longest chain of numbers that link back to 169; it tu…
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums they are not included. 题目大意: 145 是一个奇怪的数字, 因为 1! + 4! + 5!…
The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that49/98 = 4/8, which is correct, is obtained by cancelling the 9s. We shall consider fractions like, 30/50 = 3/5, to be…
The 5-digit number, 16807=75, is also a fifth power. Similarly, the 9-digit number, 134217728=89, is a ninth power. How many n-digit positive integers exist which are also an nth power? 这种数字满足下面条件: 对于数位为x的数S=k^x 有 10^(x-1)<=k^x<=10^x-1 #include &quo…
Description Problem B.Last Digit Background Give you a integer number N (1<=n<=2*10100). Pleasecompute S=11+22+33+-+NN Give the last digit of S to me. Input Input file consists of several Ns, each N a line. It is ended with N=0. Output For each…