Files
freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-457-a-polynomial-modulo-the-square-of-a-prime.english.md
Oliver Eyton-Williams bd68b70f3d Feat: hide blocks not challenges (#39504)
* fix: remove isHidden flag from frontmatter

* fix: add isUpcomingChange

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

* feat: hide blocks not challenges

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>

Co-authored-by: Ahmad Abdolsaheb <ahmad.abdolsaheb@gmail.com>
2020-09-03 15:07:40 -07:00

933 B

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f5361000cf542c510048 5 Problem 457: A polynomial modulo the square of a prime 302131

Description

Let f(n) = n2 - 3n - 1. Let p be a prime. Let R(p) be the smallest positive integer n such that f(n) mod p2 = 0 if such an integer n exists, otherwise R(p) = 0.

Let SR(L) be ∑R(p) for all primes not exceeding L.

Find 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