Prime test by non-polynomial congruence?

28 Views Asked by At

I was reading "A Synopsis of Elementary Results in Pure and Applied Mathematics" (available online (http://heybryan.org/docs/A_Synopsis_of_Elementary_Results_in_Pure.pdf)) when I saw the following paragraph:

$$\text{"If } n \text{ be a prime, every coefficient in the expansion of } (a+b)^n $$ $$\text{ except the first and last, is divisible by n"}.$$ Then I came up with the following congruence: $$5^z-(2^z+3)\equiv 0\text{ mod } z \text{ /or/ } 5^z-(3^z+2)\equiv 0\text{ mod } z$$ With some computations, I notice that with the first 30.000 numbers, all primes were passing this test, but some non-primes did pass it too, around 0.77% of numbers were not primes. Some of these non-primes were divisible by 3, 5, 7 mostly, the other were divisible by primes less than 100.

I think I'm not capable to demonstrate nothing, can you help me?

1

There are 1 best solutions below

0
On BEST ANSWER

By Fermat's Little Theorem, $a^p\equiv a\pmod p$ when $a$ is an integer and $p$ is prime. Therefore $5^p-(2^p+3)\equiv5-2-3\equiv0\pmod p$ when $p$ is prime. It's unsurprising though that the congruence holds for some composites. Compare the notion of pseudoprime.