-1

My route for checking whether a number is a prime (>3) is if n-5÷6= whole number or n-7÷6= whole number

Is this wrong please?

Sue

Sue
  • 13

2 Answers2

2

This is wrong.

$n=25$ is not prime, but $(25-7)\div 6$ is a whole number.

hdighfan
  • 4,067
1

This is wrong: it is a very elementary sieve which relies on the fact that any prime greater than $3$ is of the form $6n\pm 1$ or alternatively of the form $6m+5$ or $6m+7$.

You can tell it is wrong because dividing by $6$ can only possibly deal with the primes $2$ and $3$ - it does that efficiently enough, but leaves untested $5, 7, 11 \dots$

Mark Bennet
  • 100,194
  • Thanks Guys. I have two prime number lines which only have gaps of 6 or exact multiples of 6. One line works with -7 and the other works with -5. The 25 fell in to the -7 line so I was unsure how to explain this mathematically. It seems there may be tiers to the prime numbers. Has this been found before? – Sue Jun 08 '20 at 12:13
  • @Sue It is very well known. $6n$ is divisible by $6$; $6n+1$ is a possible prime; $6n+2$ is divisible by $2$; $6n+3$ is divisible by $3$; $6n+4$ is divisible by $2$; $6n+5$ is a possible prime and $6n+6$ is divisible by $6$ again. Nothing this elementary about primes will have escaped notice - but if you are starting it is a good observation to make,. Now try $30$ instead of $6$ to eliminate multiples of $5$ - and you will see things get a little messier (they are fine) - but the $6n\pm 1$ test is so simple that it is worth discovering and remembering. – Mark Bennet Jun 08 '20 at 19:46