Files
freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-97-large-non-mersenne-prime.english.md
Kristofer Koishigawa 6cfd0fc503 fix: improve Project Euler descriptions, challenge seeds, and test cases (#38016)
* fix: improve Project Euler descriptions and test case

Improve formatting of Project Euler test descriptions. Also add poker hands array and new test case for problem 54

* feat: add typeof tests and gave functions proper names for first 100 challenges

* fix: continue fixing test descriptions and adding "before test" sections

* fix: address review comments

* fix: adjust grids in 18 and 67 and fix some text that reference files rather than the given arrays

* fix: implement bug fixes and improvements from review

* fix: remove console.log statements from seed and solution
2020-02-28 06:39:47 -06:00

1.3 KiB
Raw Blame History

id, challengeType, title, forumTopicId
id challengeType title forumTopicId
5900f3ce1000cf542c50fee0 5 Problem 97: Large non-Mersenne prime 302214

Description

The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 269725931; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form 2p1, have been found which contain more digits.

However, in 2004 there was found a massive non-Mersenne prime which contains 2,357,207 digits: 28433×27830457+1.

Find the last ten digits of this prime number.

Instructions

Tests

tests:
  - text: <code>lrgNonMersennePrime()</code> should return a number.
    testString: assert(typeof lrgNonMersennePrime() === 'number');
  - text: <code>lrgNonMersennePrime()</code> should return 8739992577.
    testString: assert.strictEqual(lrgNonMersennePrime(), 8739992577);

Challenge Seed

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

lrgNonMersennePrime();

Solution

// solution required