Will anyone check my primality test?

186 Views Asked by At

The proof is very straightforward and simple. We all know that all prime numbers have a last digit of 1, 3, 7 or 9, and I found that any composite number with a last digit of 1,3,7 or 9 is a product of two numbers having a last digit of 1,3,7 or 9. It can't be anything else. So this way we can express any composite number $N$ with the stated last digit by : $N=(10x+m)(10y+n)$ where x and y are any positive integer. $m$ and $n$ are the possible last digits for a certain number, for example if $N \equiv 1 \pmod{10}$ then $(m,n)$ could be $(1,1),(9,9),(3,7)$ so we have 3 separate equations to check if any number ending in 1 is composite or not. of course if there is no pair of positive integer $x$ and $y$ that satisfy any of the 3 equations (other than having any of the values within any of the brackets 1). so the way to do the test would be by making a simple change of subject to get $y=N/(100x+10m) - n/10$ and run it for all integers of x less than the square root of the number we want to test so this way we have 9 different equations to express any composite number having a last digit of 1,3,7 or 9

3 for numbers ending in 1

2 for numbers ending in 3

2 for numbers ending in 7

3 for numbers ending in 9

I know it's not as fast as other tests out there, but please tell me: what do you think of my work?