You are viewing a single comment's thread. Return to all comments →
You have to consider all integers between 0 to k (both inclusive) that show a property like:
f(n) = sum of squares of digits of n = a perfect square
Example: f(100) = 1^2 + 0^2 + 0^2 = 1 => A perfect square. So add 100 to your overall sum
f(101) = 1^2 + 0^2 + 1^2 = 2 => Not a perfect sqaure. So leave it.
Continue in such way for n in [0,k] and sum for all such n.
Hope that helps!
Project Euler #171: Finding numbers for which the sum of the squares of the digits is a square
You are viewing a single comment's thread. Return to all comments →
You have to consider all integers between 0 to k (both inclusive) that show a property like:
f(n) = sum of squares of digits of n = a perfect square
Example: f(100) = 1^2 + 0^2 + 0^2 = 1 => A perfect square. So add 100 to your overall sum
f(101) = 1^2 + 0^2 + 1^2 = 2 => Not a perfect sqaure. So leave it.
Continue in such way for n in [0,k] and sum for all such n.
Hope that helps!