freeCodeCamp/curriculum/challenges/english/10-coding-interview-prep/project-euler/problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1.md
Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

809 B

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
5900f4451000cf542c50ff57 Problem 216: Investigating the primality of numbers of the form 2n2-1 5 301858 problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1

--description--

Consider numbers t(n) of the form t(n) = 2n2-1 with n > 1.

The first such numbers are 7, 17, 31, 49, 71, 97, 127 and 161.

It turns out that only 49 = 7*7 and 161 = 7*23 are not prime.

For n ≤ 10000 there are 2202 numbers t(n) that are prime.

How many numbers t(n) are prime for n ≤ 50,000,000 ?

--hints--

euler216() should return 5437849.

assert.strictEqual(euler216(), 5437849);

--seed--

--seed-contents--

function euler216() {

  return true;
}

euler216();

--solutions--

// solution required