How to tell if number is a prime number

Jand

New member
Joined
Oct 13, 2014
Messages
9
I adapted this from the work of the brilliant Peter Plichta.

First you need to know the first 6 low prime numbers up to 11 (1, 2, 3, 5, 7, 11).
After this call the number you want to test P.

Use [(P-5 or P-7) / 6 = an integer] to test if the number is a prime.

For example - say you want to know if 911 is a prime number:

(911 - 5) / 6 = 151 (is an integer - so 911 is a prime number)
(911 - 7) / 6 = 150.667 (disregard)

Another example: 7017

(7017 - 5) / 6 = 1168.667 (disregard)
(7017 - 7) / 6 = 1168.333 (disregard both - so 1717 is not a prime number)

And another example:
(4909 - 5) / 6 = 817.333 (disregard)
(4909 - 7) / 6 = 817 (is an integer - so 4909 is a prime number)

This comes in useful for trig problems when you are left with a horrible radical to simply (say (127)^0.5) - you can be fiddling about and fretting thinking ("this must have factors - what am I missing?") but:

(127 - 5) / 6 = 20.333 (disregard)
(127 - 7) / 6 = 20 (is an integer - so 127 is a prime number)

127 is a prime number and has no factors (except 1 and itself) - so you can use this simple method
[(P-5 or P-7) / 6 = an integer] to be confident you have fully solved the problem when asked to present something in its simplest form.

For fun lets see if th
e US federal debt (to the nearest dollar - today 18 December 2014) is a prime number:

($18,033,285,352,731 - 5) / 6 = 3005547558787.667 (disregard)
($18,033,285,352,731 - 7) / 6 = 3005547558787.333 (disregard both) - so $8,033,285,352,731 is not a prime number but it is big [$150,277 for every working person in the USA]).
 
Last edited:
I adapted this from the work of the brilliant Peter Plichta.

First you need to know the first 6 low prime numbers up to 11 (1, 2, 3, 5, 7, 11).
After this call the number you want to test P.

Use [(P-5 or P-7) / 6 = an integer] to test if the number is a prime.

For example - say you want to know if 911 is a prime number:

(911 - 5) / 6 = 151 (is an integer - so 911 is a prime number)
(911 - 7) / 6 = 150.667 (disregard)

What? You are just testing whether P- 5 is divisible by 6? That does NOT tell whether P is prime or not.
911- 5 is divisible by 6 and happens to be prime but 65- 5= 60 is certainly divisible by 6 and 65 is NOT prime!
 
I fell over in the bath and hit my head last night .... I'll think about the problem to see if I can come up with something that makes sense.
 


First you need to know the first 6 low[est] prime numbers up to 11 (1, 2, 3, 5, 7, 11). is a prime number:


Jand, the first number in the list is wrong, because 1 is not a prime number.


So, maybe you want the first five prime numbers up to and including 11?

Or, maybe you want the first six prime numbers up to and including 13?


Or something else?
 
I's not complete idiocy

There are 168 prime numbers between 2 and 100.

Unfortunately [(P-5 or P-7) / 6 = an integer] to test if the number is a prime - also picks up some non-primes.

25,35,45,49,55,65,77,85,91 etc.

5(5+6P) gets rid of some of the non-primes (25,55,85,115 etc.)

and

7(7+6P) gets rid of more of the non-primes (49,91,133 etc.)

There is still some more to get rid of ....

I'll keep thinking about it - but my cat has a bad leg from fence jumping and needs my nursing care at the moment.
 
I's not complete idiocy

There are 168 prime numbers between 2 and 100.

Unfortunately [(P-5 or P-7) / 6 = an integer] to test if the number is a prime - also picks up some non-primes.

25,35,45,49,55,65,77,85,91 etc.

5(5+6P) gets rid of some of the non-primes (25,55,85,115 etc.)

and

7(7+6P) gets rid of more of the non-primes (49,91,133 etc.)

There is still some more to get rid of ....

I'll keep thinking about it - but my cat has a bad leg from fence jumping and needs my nursing care at the moment.

Really - There are only 99 integers between 2 and 100 (including both). Prime being integer by definition - how would you fit 168 of those in 99 slots?!!

How is your head - you told us that you had been hurt!!
 
Top