7 kyu

Mersenne Primes

241 of 299Staples

Description:

A Mersenne prime is a prime number that can be represented as: Mn = 2n - 1. Therefore, every Mersenne prime is one less than a power of two.

Write a function that will return whether the given integer n will produce a Mersenne prime or not.

The tests will check random integers up to 2000.

Algorithms

More By Author:

Check out these other kata created by Staples

Stats:

CreatedFeb 1, 2016
PublishedFeb 1, 2016
Warriors Trained619
Total Skips12
Total Code Submissions2274
Total Times Completed299
Python Completions241
Haskell Completions55
Ruby Completions29
Total Stars6
% of votes with a positive feedback rating73% of 117
Total "Very Satisfied" Votes73
Total "Somewhat Satisfied" Votes25
Total "Not Satisfied" Votes19
Total Rank Assessments13
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Staples Avatar
  • anter69 Avatar
  • Voile Avatar
  • KenKamau Avatar
  • ejini战神 Avatar
  • saudiGuy Avatar
Ad