Well, I need someone here with programming skills (because I have none of it) to check if this problem that I am proposing is at least true for the known Mersenne primes, and here is the list of the exponents of the known Mersenne primes :


<http://wwwhomes.uni-bielefeld.de/achim/mersenne.html>


And the problem is:


If the number $M\_p=2^p-1$ is prime then it can be written in one of the two following forms:


$M\_p=18k+1$ or $M\_p=18k+13$, for $p\geq5$, that is, Mersenne primes, when divided with $18$ leave a remainder that is equal to $1$ or equal to $13$.


I feel that this is quite easy to program but since my skills in programming are practically non-existent it would be so nice if someone here would do that job for me (and for himself if he is interested in this kind of problems).


If this is a proven fact about Mersenne primes then please tell me where I can find the proof because I did not find fact of this kind when I was reading about known facts about Mersenne primes, and I am sorry if this is something quite elementary beacuse I already posted some questions which turned out to be homework-type problems and I did not see it in the moment of posting. Thank you.



Mersenne primes problem
No programming skills are needed, not even a computer, or even pocket-calculator ;) 


Look, $M\_p = 2^p - 1$ is congruent $1$ or $13$ modulo $18$ (which is what you are asking) if and only if $2^p$ is $2$ or $14$ modulo $18$. 


Now, modulo $18$, one has $2^1=2$, $2^2=4$, $2^3= 8$, $2^4= 16$, $2^5= 14$, $2^6=10$, $2^7=2$.


Thus, $2^n$ is congruent $2$ modulo $18$ if and only if $n$ is $1$ modulo $6$, 
and $2^n$ is congruent $14$ modulo $18$ if and only if $n$ is $5$ modulo $6$.


Since every prime (except $2,3$) is $1$ or $5$ modulo $6$, and the exponent for a Mersenne-prime is a prime number the claim follows. 


