freeCodeCamp/curriculum/challenges/russian/08-coding-interview-prep/project-euler/problem-457-a-polynomial-mo...

1.2 KiB

id challengeType title forumTopicId localeTitle
5900f5361000cf542c510048 5 Problem 457: A polynomial modulo the square of a prime 302131 Задача 457: Полином по модулю квадрата простого

Description

Пусть f (n) = n2 - 3n - 1. Пусть p - простое число. Пусть R (p) - наименьшее натуральное число n такое, что f (n) mod p2 = 0, если такое целое число n существует, в противном случае R (p) = 0.

Пусть SR (L) - ΣR (p) для всех простых чисел, не превосходящих L.

Найдите SR (107).

Instructions

Tests

tests:
  - text: <code>euler457()</code> should return 2647787126797397000.
    testString: assert.strictEqual(euler457(), 2647787126797397000);

Challenge Seed

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

euler457();

Solution

// solution required