Total Pageviews

Search This Blog

Saturday, September 30, 2023

A Proof of a Conjecture About Prime Numbers, Willans' Formula, and a New Primality Test

I have been playing around with conjectures involving prime numbers. Since I didn't get anywhere with the Goldbach Conjecture, I started looking at the differences of the squares of consecutive primes. That led to something interesting. 

The whole proof is here: Glibertarians | But you said there would be no math!

If you would like to prove it for yourself, here are the building blocks:

***

[My] conjecture: The difference of the squares of any two prime numbers 5 or above is divisible by 6. (Whiz’s corollary: said difference is also divisible by 24.)

Theorem 1: The differences of the squares of any two odd numbers is divisible by 8.

Theorem 2: The difference of squares of any two numbers that are not divisible by 3 is divisible by 3.

Proof of the conjecture: Since all primes 5 or above are both odd and not divisible by 3, by Theorems 1 and 2 the difference of their squares is divisible by 8 and 3, respectively, and therefore also divisible by 24. Q.E.D.

***

See update below. I was bit hasty in my claims here. My mistake was failing to note that there are composite numbers greater than 5 which are both odd and not divisible by 3. For those numbers, the difference of the squares will also be 24, at least in some cases. The good news is that if we can prove a number, n, is NOT prime with the following test:

sqrt((n^2 - 25)/24)

If the result of the above is not an integer, then n is not prime. 

An interesting upshot to this theorem is that if you want to find the larger prime than n, simply square n, add 24, and take the square root. Repeat with larger multiples of 24 if the result is not an integer. Here are some examples:

5^2 + 24 = 49                        sqrt(49) = 7

7^2 + 3*24 = 121                  sqrt(121) = 11

11^2 + 2*24 = 169                sqrt(169) = 13

13^2 + 5*24 = 289                sqrt(289) = 17

If we skip a bit to some larger primes...

9001^2 + 4502*24 = 81126049        sqrt(81126049) = 9007

Note that 9001 and 9007 are consecutive primes. 

Willans' Formula generates all primes in order, but it takes a long time to compute large primes. 

In contrast, if a large prime is already known, then the next larger prime will follow the pattern shown above. 

Indeed, if we start with just 5, we can compute all other primes greater than 5. Like so:

5^2 + 24 = 49                    sqrt(49) = 7

5^2 + 4*24 = 121              sqrt(121) = 11

5^2 + 6*24 = 169              sqrt(169) = 13

5^2 + 11*24 = 289            sqrt(289) = 17

for the same large primes given above, we get: 

5^2 + 3375749*24 = 81018001        sqrt(81018001) = 9001

5^2 + 3380251*24 = 81126049        sqrt(81126049) = 9007

Update: 10,006,721 is prime, yet I have found some counterexamples to my conjecture with it. 

For example, (10006723^2 - 10006721^2)/24 = 1667787, but 10,006,723 is not prime, though it has only 2 other factors besides 1 and itself. So while my conjecture removes most factors, it does not get all of them. 

However, if we find sqrt((1000623^2 - 25)/24), we get a non-integer, and this tells us that 1000623 is not prime. 

The next prime after 10,006,721 is 10,006,741. 

Here is an online prime number calculator:

Prime Number Calculator (calculatorsoup.com)

No comments: