11

I asked this question on puzzling.se and someone suggested I post it here:

I discovered this by accident, when trying to create a formula that generates prime numbers (an impossible task, I know).

But, I find it very interesting that you take any prime number 5 and greater, then you square it and subtract 1, dividing it by 24 always results in a whole integer.

For example:

5 x 5 = 25 - 1 = 24 / 24 = 1
7 x 7 = 49 - 1 = 48 / 24 = 2
11 x 11 = 121 - 1 = 120 / 24 = 50

The result is always a whole number, regardless of how high the prime number is.

Can someone explain why this is so, mathematically? This does not seem possible (to me). And if this is really true, why can I find nothing written about it?

I have never heard of this theorem before, and nothing is mentioned on Wikipedia or other sources. But perhaps this could be a helpful in reducing $33\%$ of the possibilities when trying to find or prove large prime numbers, computationally.

UPDATE: lab made the observation that all resulting numbers are apparently also divisible by $24$ .. interesting

UPDATE: following lab's observation , I tried $24 \times 24 = 576 + 1 = 577$ ( a prime number) .. interesting and.. $576 \times 576 + 1 = 331,777$ which is also a prime

Further extrapolating in the gap of numbers between $2$ and $50$:

primes:

24 x 3 = 72 + 1 = 73  72 - 1 = 71  72 + 7 = 79
24 x 4 = 96 + 1 = 97   96 + 5 = 101  96 + 7 = 103   
24 x 5 = 120 - 7 = 113  120 + 7 = 121
24 x 6 = 144 - 7 = 137  144 + 7 = 151
24 x 7 = 168 - 1 = 167  168 + 5 = 173
24 x 8 = 192 - 1 = 191  192 + 5 = 197
24 x 9 = 216 + 7 = 223

Not a perfect formula for finding primes, but seems to be effective :-)

Relure
  • 4,185
  • The key point is that the prime is congruent to either 1 or 2, mod 3, and $1^2 = 1 \pmod{3}$, and $2^2 = 1 \pmod{3}$. – Carl Mummert Feb 13 '15 at 12:40
  • I hope this doesn't come off the wrong way, but I think you shouldn't be so excited about this observation, unless you are equally interested by facts like "every prime number greater than $3$ is not divisible by $3$!" – Zubin Mukerjee Feb 13 '15 at 15:35
  • 1
    Zubin, I am interested in patterns. I find it fascinating that every prime number > 3 can be expressed as 6n ± 1 , which is more important and different than saying every prime number greater than 3 is not divisible by 3. – Michael Rize Feb 16 '15 at 00:19

4 Answers4

28

Your observation holds for any integer that is not divisible by $3$, not just primes. Indeed, $n^2-1=(n+1)(n-1)$ and one of the numbers $n+1$, $n-1$ is a multiple of $3$ unless $n$ is a multiple of $3$.

  • very interesting. Thanks for that observation! But, in light of new information, apparently only the prime number sequence is divisible by 12 after squaring them and subtracting 1. For example 100 - 1 = 99 .. which is divisible by 3 but not divisible by 12 . – Michael Rize Feb 13 '15 at 12:42
  • @MichaelRize See lab bhattacharjee's answer. (In short; 10 is divisible by 2, so 10^2-1 is not divisible by 4) – Taemyr Feb 13 '15 at 12:43
  • so the above equation only works on numbers not divisible by 3 AND numbers not divisible by 2? – Michael Rize Feb 13 '15 at 12:45
  • @MichaelRize: if $n$ is not divisible by $3$ then either $(n+1)$ or $n-1$ must be divisible by $3$ (because if you have 3 numbers in a row at least one is divisible by 3) so $n^2-1$ is divisible by 3. If $n$ is not divisible by $2$ then both $n+1$ and $n-1$ are even, so $n^2-1$ is divisible by $4$. A number is divisible by $12$ if and only if it is divisible by $4$ and $3$. Putting these facts together explains the data! – hunter Feb 13 '15 at 12:56
  • @MichaelRize Number 25 certainly is not a prime, however $25^2-1 = 624 = 52\times 12$ (and for any $n=6k+1$ you have $n^2-1=12(3k+1)k$). – CiaPan Feb 13 '15 at 13:33
  • thanks CiaPan .. I know there are exceptions, but the point (to me) is that not every number fits the equation, but all prime numbers do, which I found interesting. Then I discovered another question on here, which I did not see before, that covers the same topic. Very interesting stuff. – Michael Rize Feb 13 '15 at 14:42
  • thanks hunter.. I understand it more clearly now. – Michael Rize Feb 13 '15 at 14:44
25

Any integer can be expressed as $6n,6n\pm1,6n\pm2,6n+3$ where $n$ is any integer

Observe that, any prime number $>3,$ can be expressed as $6n\pm1$

Now, $(6n\pm1)^2=36n^2\pm12n+1=24n^2+24\dfrac{n(n\pm1)}2+1\equiv1\pmod{24}$

So, any integer of the form $6n\pm1$ will satisfy the proposition, we don't even need primes

5

I'll use Fermat's little theorem:

"If $a \in \Bbb N$ is any natural number, and $p$ is a prime number, such that $gcd(a,p) = 1$, then $a^{p - 1} \equiv 1 \ (mod \ p)$".

We have that $3$ is prime, and every prime $p > 3$ is coprime with $3$. Consequently:

$$\forall \ prime \ p > 3, \ p^{3 - 1} \equiv 1 \ (mod \ 3), \ i.e. \ p^2 \equiv 1 \ (mod \ 3)$$

This means that for any prime number $p > 3$, $p^2$ leaves remainder $1$ upon division by $3$, i.e. $p^2 - 1$ leaves remainder $0$ upon division by $3$.

  • thanks for the comment, very interesting, especially if my math level was high enough to comprehend it. Why is every number also divisible by 24? – Michael Rize Feb 13 '15 at 12:58
  • 1
    You might consider using \pmod for congruencies: a \equiv b \pmod c results in $a \equiv b \pmod c$. – CiaPan Feb 13 '15 at 13:41
5

This answer walks through some simple math, and pulls the answer out in the last paragraph:

Squaring n and subtracting one gives n²-1, which can be rewritten as (n+1)(n-1).

If n doesn't divide by 3, then one of n+1 and n-1 divides by 3 (because of the three consecutive numbers n-1, n and n+1, exactly one of them must divide by 3).

If n doesn't divide by 2, then both n+1 and n-1 divide by 2, and (exactly) one of those divides 4.

This means that if n doesn't divide 2 or 3 (for example, if it's a prime number that's 5 or higher), then (n+1)(n-1) divides by 2, 3, and 4 (or to put it more clearly, it divides by 3 and 8), and hence divides 24.