# Number squared minus 1 never prime?

It seem like if you take a number and square it and subtract 1 it is never prime. Of course if you take an odd number and square it and subtract one you get an even number.I have been making my own table of primes and so far the squares -1 are not prime. Do I need to try more numbers? Thanks, Charles Vossbrinck

• In order that $n^2-1=(n-1)(n+1)$ is a prime we need that $\{(n-1),(n+1)\}=\{\pm 1,\pm p\}$ and that happens only in very few cases. – Jack D'Aurizio Mar 23 '17 at 16:36
• In light of the previous comment, you indeed won't find much. But - did you really miss $2^2 - 1 = 3$ ? – sTertooy Mar 23 '17 at 16:44
• It should be mentioned that $3$ is prime and is equal to $2^2-1$. This shouldn't be overlooked when attempting to write an accurate statement which would instead be "for any natural number $n\geq 3$ one has $n^2-1$ is not prime" – JMoravitz Mar 23 '17 at 16:45

Well, yes (apart from the trivial case of $n=2$) because
$$n^2-1=(n-1)(n+1)$$
and so $n-1$ divides $n^2-1$.
• To add to the above, $(n-1)=1$ should also be treated separately, since that's the trivial factor. – Mitchell Faas Mar 23 '17 at 16:48
All powers (except powers of 2) minus 1 are compound numbers (not prime) because we must always have for any integer A greater than 2 and integer $x$ greater than 1 $$\frac{A^x-1}{A-1}$$ is an integer. Thus $A^x-1$ is always divisible by $A-1$ and is therefore not prime.