freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-273-sum-of-squares....

1.3 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f47e1000cf542c50ff90 5 Problem 273: Sum of Squares Задача 273: Сумма квадратов

Description

Рассмотрим уравнения вида: a2 + b2 = N, 0 ≤ a ≤ b, a, b и N целое число.

Для N = 65 существуют два решения: a = 1, b = 8 и a = 4, b = 7. Назовем S (N) суммой значений a всех решений a2 + b2 = N, 0 ≤ a ≤ b, a, b и N целых чисел. Таким образом, S (65) = 1 + 4 = 5. Найти ΣS (N), для всех квадратов N, только делимых штрихами вида 4k + 1 с 4k + 1 <150.

Instructions

Tests

tests:
  - text: <code>euler273()</code> должен вернуть 2032447591196869000.
    testString: 'assert.strictEqual(euler273(), 2032447591196869000, "<code>euler273()</code> should return 2032447591196869000.");'

Challenge Seed

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

euler273();

Solution

// solution required