freeCodeCamp/curriculum/challenges/arabic/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-numbe...

1.3 KiB

title id challengeType videoUrl localeTitle
Factors of a Mersenne number 598eea87e5cf4b116c3ff81a 5

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(typeof check_mersenne === "function", "<code>check_mersenne</code> is a function.");'
  - text: ''
    testString: 'assert(typeof check_mersenne(3) == "string", "<code>check_mersenne(3)</code> should return a string.");'
  - text: ''
    testString: 'assert.equal(check_mersenne(3),"M3 = 2^3-1 is prime","<code>check_mersenne(3)</code> should return "M3 = 2^3-1 is prime".");'
  - text: ''
    testString: 'assert.equal(check_mersenne(23),"M23 = 2^23-1 is composite with factor 47","<code>check_mersenne(23)</code> should return "M23 = 2^23-1 is composite with factor 47".");'
  - text: ''
    testString: 'assert.equal(check_mersenne(929),"M929 = 2^929-1 is composite with factor 13007","<code>check_mersenne(929)</code> should return "M929 = 2^929-1 is composite with factor 13007");'

Challenge Seed

function check_mersenne (p) {
  // Good luck!
}

Solution

// solution required