# How to find all prime numbers in the form $n^m+1$ or $n^m-1$? [closed]

I was asked to find all the prime numbers in these forms and prove that these are the only prime numbers in these forms. From some basic research on the internet, I suspect it may have been a trick question and that it is conjectured that they are infinite primes in this form.

I am aware there is a unique prime in the form $n^2-1$, $n^3-1$, using the $(n-1)$ factorisation.

Please would you help.

EDIT: this is meant to be a generalisation for any positive integers, n and m.

## closed as unclear what you're asking by TMM, Frits Veerman, jgon, Namaste, ShaileshOct 5 '16 at 0:39

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• This question is a bit odd, to ask especially when we do not even know the finiteness of Fermat primes $2^{2^n} + 1$. – астон вілла олоф мэллбэрг Oct 4 '16 at 11:28
• @астонвіллаолофмэллбэрг Or Mersenne primes, or $n^2+1$ primes. – Parcly Taxel Oct 4 '16 at 11:29
• Exactly. I added the Fermat primes because they seem very rare compared to the other sequences. – астон вілла олоф мэллбэрг Oct 4 '16 at 11:30
• Maybe the question is to find all factors of $n^m \pm 1$, similar to how $n^2 - 1$ factors as $(n-1)(n+1)$? (I'm just guessing though - otherwise the question just does not make sense.) – TMM Oct 4 '16 at 12:20

there is an infinite number of primes of the form $n^1 + 1$
if there was a finite set in the form $n^1 + 1$, then multiplying them all together and adding $1$ would also be of the form $n^1 + 1$ for some new n, and it would be a new prime number, not in the original set - so it could never be true
• The intent is certainly that $m$ is an integer greater than $1$. That OP does not make it explicit is maybe worth a comment, yet not giving an answer based on a loophole. – quid Oct 4 '16 at 12:06