freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square.english.md
Valeriy 79d9012432 fix(curriculum): quotes in tests (#18828)
* fix(curriculum): tests quotes

* fix(curriculum): fill seed-teardown

* fix(curriculum): fix tests and remove unneeded seed-teardown
2018-10-20 23:32:47 +05:30

1.0 KiB

id, challengeType, title
id challengeType title
5900f4181000cf542c50ff2a 5 Problem 171: Finding numbers for which the sum of the squares of the digits is a square

Description

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.

Instructions

Tests

tests:
  - text: <code>euler171()</code> should return 142989277.
    testString: assert.strictEqual(euler171(), 142989277, '<code>euler171()</code> should return 142989277.');

Challenge Seed

function euler171() {
  // Good luck!
  return true;
}

euler171();

Solution

// solution required