Files
freeCodeCamp/curriculum/challenges/chinese/10-coding-interview-prep/project-euler/problem-216-investigating-the-primality-of-numbers-of-the-form-2n2-1.md
Oliver Eyton-Williams dec409a4bd fix: s/localeTitle/title/g
2020-10-06 23:10:08 +05:30

954 B
Raw Blame History

id, challengeType, videoUrl, title
id challengeType videoUrl title
5900f4451000cf542c50ff57 5 问题216调查2n2-1形式的数字的素数

Description

考虑形式为tn= 2n2-1的数字tn其中n> 1.第一个这样的数字是7,17,31,49,71,97,127和161.事实证明只有49 = 7 * 7和161 = 7 * 23不是素数。对于n≤10000有2202个数字tn是素数。

对于n≤50,000,000有多少个数tn是素数

Instructions

Tests

tests:
  - text: <code>euler216()</code>应该返回5437849。
    testString: assert.strictEqual(euler216(), 5437849);

Challenge Seed

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

euler216();

Solution

// solution required

/section>