freeCodeCamp/curriculum/challenges/portuguese/08-coding-interview-prep/project-euler/problem-123-prime-square-re...

1.0 KiB
Raw Blame History

id challengeType title videoUrl localeTitle
5900f3e71000cf542c50fefa 5 Problem 123: Prime square remainders Problema 123: Resíduos quadrados principais

Description

Seja pn o nono primo: 2, 3, 5, 7, 11, ..., e seja r o resto quando (pn 1) n + (pn + 1) n é dividido por pn2. Por exemplo, quando n = 3, p3 = 5 e 43 + 63 = 280 ≡ 5 mod 25. O menor valor de n para o qual o restante excede 109 é 7037. Encontre o menor valor de n para o qual o restante excede primeiro 1010

Instructions

Tests

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

Challenge Seed

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

euler123();

Solution

// solution required