freeCodeCamp/curriculum/challenges/portuguese/08-coding-interview-prep/project-euler/problem-171-finding-numbers...

1.1 KiB

id challengeType title videoUrl localeTitle
5900f4181000cf542c50ff2a 5 Problem 171: Finding numbers for which the sum of the squares of the digits is a square Problema 171: Encontrar números para os quais a soma dos quadrados dos dígitos é um quadrado

Description

Para um inteiro positivo n, seja f (n) a soma dos quadrados dos dígitos (na base 10) de n, por exemplo, f (3) = 32 = 9, f (25) = 22 + 52 = 4 + 25 = 29, f (442) = 42 + 42 + 22 = 16 + 16 + 4 = 36 Encontre os últimos nove dígitos da soma de todos n, 0 <n <1020, tal que f (n) é um quadrado perfeito.

Instructions

Tests

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

Challenge Seed

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

euler171();

Solution

// solution required