Saturday, May 3

The Prime Test

A while ago, some famous math guys came up with a new theorem to test for primes. That is, you can use this test to find out if any number is prime. The test is much better to use with smaller numbers, because the bigger a number, the longer it takes to run this test.
By the way, I saw this on a Youtube video, but I noticed a pattern a while ago related to this.

~~~~~~~~~~

Let's go back to Pascal's Triangle. Pascal's Triangle is a sort of array of numbers starting at one at the top, and each number is the sum of the two numbers above it. It looks like this:
Now take a look at the rows whose second number is prime. All of the numbers following it are divisible by it-- excluding 1. And all of the composite numbers don't have this property.

You also have probably heard of the Binomial Theorem. This theorem states that all coefficients of the expansion of:
(x+1)^n      (or (a+b)^n)
are the terms of the nth row of Pascal's Triangle, which is also a cool property.
So if we combine our previous discovery and the Binomial Theorem, we can get:
"All of the coefficients of the expansion of (x+1)^n are divisible by n if and only if n is prime, excluding the coefficient one of the first and last terms."
And if we get rid of that last part and reverse that, we get:
"Any whole number n is prime if all of the coefficients of
(x+1)^n - x^n - 1
are divisible by n."

Let's try it out, hmm?
7: coefficients are 7, 21, 35, 35, 21, 7    yes
10: 10, 45, 120, 210, 252, 210, 120, 45, 10   no

It works!

I just thought that this was a really interesting breakthrough.

Sty coolio,
John

No comments:

Post a Comment

Comment if you dare