You've misunderstood the problem slightly. It's not asking if nis a Mersenne prime, but if it produces a Mersenne prime using the provided definition (Mn = 2n - 1).
An Issue is for reporting that something needs to be changed about the kata itself. Use Question for questions about your own code. If you think something should change about the description then you need to elaborate - an Issue needs to be something actionable.
This is because substr prints the number of characters after the starting index. Had you started from 0, you would just need to subtract 1 to exclude the last element.
But since you have started from 1, it has shifted the range by 1, which means the last character is included again. So you need to subtract 2.
This comment has been reported as abusive
Kata retired.
It wants the first character removed as well, if you set it to 0 it will also grab that character.
Just curious why is it 1 instead for 0? Isn't the first letter placed at 0?
Great!
Yes, i agree on this one.
Oh I see youre right! thank you for pointing that out. :)
You've misunderstood the problem slightly. It's not asking if
n
is a Mersenne prime, but if it produces a Mersenne prime using the provided definition (Mn = 2n - 1).This comment is hidden because it contains spoiler information about the solution
Approved
python new test framework is required. updated in this fork
basic tests could be added in full tests suite.
An
Issue
is for reporting that something needs to be changed about the kata itself. UseQuestion
for questions about your own code. If you think something should change about the description then you need to elaborate - anIssue
needs to be something actionable.This comment is hidden because it contains spoiler information about the solution
This is because substr prints the number of characters after the
starting index
. Had you started from0
, you would just need to subtract1
to exclude thelast element
.But since you have started from
1
, it has shifted the range by1
, which means the last character is included again. So you need to subtract2
.Loading more items...