0%

Problem 171


Problem 171


Finding numbers for which the sum of the squares of the digits is a square

For a positive integer n, let f(n) be the sum of the squares of the digits (in base 10) of n, e.g.

f(3) = 32 = 9,
f(25) = 22 + 52 = 4 + 25 = 29,
f(442) = 42 + 42 + 22 = 16 + 16 + 4 = 36

Find the last nine digits of the sum of all n, 0 < n < 1020, such that f(n) is a perfect square.


寻找数字平方和为平方数的数

对于正整数n,记f(n)为n(十进制表示下)的各位数的平方和,例如

f(3) = 32 = 9,
f(25) = 22 + 52 = 4 + 25 = 29,
f(442) = 42 + 42 + 22 = 16 + 16 + 4 = 36

找出所有满足0 < n < 1020,且各位数字平方和为平方数的数n,求出它们的和的最后九位数字。