freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-457-a-polynomial-modulo-the-square-of-a-prime.english.md
mrugesh 22afc2a0ca feat(learn): python certification projects (#38216)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
Co-authored-by: Kristofer Koishigawa <scissorsneedfoodtoo@gmail.com>
Co-authored-by: Beau Carnes <beaucarnes@gmail.com>
2020-05-27 13:19:08 +05:30

949 B

id, challengeType, isHidden, title, forumTopicId
id challengeType isHidden title forumTopicId
5900f5361000cf542c510048 5 false 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