I don't know...it the result is correct but...2^n-1 is prime when n is an odd number...not all odd number but n has to be of the odd form...and 2^n+1 is prime...when n is some even number...
Have you thought about using mathematical induction?
Set up your base case: n = 3
You will show that [tex]2^3-1 = 8 - 1 = 7[/tex] is prime and [tex]2^3 + 1 = 9[/tex] is not since [tex]9 = 3 \cdot 3[/tex].
Assume that it's true for n. Then prove the case for n + 1.