## Mersenne primes problem

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.

-
I found this question somehow nice, so I answered it. But as a general advice, I think to use primarily math.stackexchange.com and MO only if the feedback there suggests it is a good idea to do so, in the long run will give the better experience for you. – quid Jan 29 at 14:12
@Antisha: This site is mainly reserved for professional mathematicians (with a Ph.D.) or graduate students (who are working on a thesis towards a Ph.D.). My impression is that you don't have this expertise, so most likely you will not be able to ask a question "of research level", i.e. one that is of interest here. Of course, with a good instinct or luck you might succeed, but the chances are against you. – GH Jan 29 at 14:39
@Antisha: Also, you are not supposed to ask here for comments or opinions about a result you proved. That belongs to discussion boards, blogs, conferences, journal submissions etc. – GH Jan 29 at 14:42
I didn´t see this at the time of writing my post, but I would like when it is posted now that you give an opinion about the result, if it is not good enough I will post no more here. – Antisha Jan 29 at 14:53

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.

-
 You beat me by a minute or two... – GH Jan 29 at 14:11 I am amazed how two of you see these things in a so short period of time. Okay, I will post no more until I have a really good question that is on the research level. Thank you. – Antisha Jan 29 at 14:14 @GH: 120 seconds, to be precise ;) – quid Jan 29 at 14:16 I will now write a post about something about prime numbers that I managed to prove so I would like to see your comments about usefulness of such a formula. – Antisha Jan 29 at 14:27

It is an easy exercise to prove your statement for all Mersenne primes, not just the known ones, using that $2^6\equiv 1\pmod{9}$. Indeed, $p$ must be prime for $M_p=2^p-1$ to be prime. Hence either $p\equiv 1\pmod{6}$ in which case $M_p\equiv 2^1-1\equiv 1\pmod{9}$ and so $M_p\equiv 1\pmod{18}$, or $p\equiv 5\pmod{6}$ in which case $M_p\equiv 2^5-1\equiv 4\pmod{9}$ and so $M_p\equiv 13\pmod{18}$. I told you earlier that your questions are not of research level. Try MathStackExchange next time.

-