# Prime of form $n^2-4$

Show that The only prime of the form $n^2-4$, $n$ being an integer is $3$

We have $n^2-4=(n+2)(n-2)$ Now for $n^2-4$ being prime value of $(n-2)$ must be $1$. Then $n=3$ and putting the value we get $n=(3^2-4)=5$ But we need to get $3$ instead of $5$

But when we put $n=1$ then we get $n^2-4=-3$ may it be a printing mistake?

• You've already written a factoring! What's left to do? Clearly the question was to show that $n=3$ was the only way to get a prime.
– lulu
Jun 14, 2018 at 10:34
• For what $n$ is 3 such a prime? There’s no integer $n$ for which $n^2 - 4 = 3$ more or less exactly by the reasoning you have. Why do you think you need $3$ instead of $5$? Jun 14, 2018 at 10:35
• No, $3$ is not of the form $n^2-4$.
– user65203
Jun 14, 2018 at 10:37
• Look at the question at top it says so Jun 14, 2018 at 10:37
• Then is the question wrong? Jun 14, 2018 at 10:38

Since $n^2-4=3$ leads to $n^2=7$, we can conclude that $3$ is not of the form $n^2-4$.

Since $n^2-4=(n+2)(n-2)$, this can only be a prime if $n-2=1$ and $n+2$ is prime, which happens for $n=3$.

The only prime of the form $n^2-4$ is $5$, which is obtained from $n=3$.

The only prime of the form $(n+2)(n-2)$ can be obtained when $n-2=1$, to avoid a factor. And it turns out that with $n=3$, $n+2=5$ is also a prime.

Hence there is one and only one solution,

$$3^2-4.$$

The way I proved it:

$$n^2 - 4 = (n+2)(n-2) = p$$

Since $$p$$ is a prime number, we know its only factors are $$p$$ and $$1$$:

$$(n+2)(n-2) = p*1$$

Therefore, either $$n+2 = 1$$ or $$n-2=1$$ (and the other factor equals $$p$$).

Case 1: $$n+2 = 1 \implies n = -1 \implies n^2 - 4 = (-1)^2 - 4 = -3$$, which is not prime.

Case 2: $$n-2 = 1 \implies n = 3 \implies n^2 - 4 = (3)^2 - 4 = 5$$, which is prime

Let us consider $p=n^2-4$ be a prime, where $n\ge3$

Since, for $n=1,2,$ $p$ is negative or zero

$p=n^2-4=(n-2)(n+2)$

If $n>3,$ then $n-2>1$ and $n+2>1$

$=> p$ is not a prime

Therefore, $n=3$ is the only possibility.

If $n=3,$ then $p=3^2-4=5$

Therefore, $5$ is the only prime of the form $n^2-4$