Somewhere on this site it was mentioned that all primes greater than or equal to 5 are produced by the formulas 6n+1 or 6n-1 but not all 6n+1 or 6n-1 are prime. I've been playing around with this and it seems that when a number produced by these formulas is composite, it is never divisible by 3. Is this the case?
6n is always divisible by 3, but 6n+1 would leave a remainder of 1 on division by 3, and 6n-1 a remainder of -1 whether prime or composite.
Yes, 6n+-1 are exactly the numbers which are neither divisible by 2 nor by 3, for the reasons explained by Shaun.
Likewise, divisibility by 5 could be excluded by only checking the numbers
*26n+-1, *26n+-7, *26n+-E, *26n+-11,
but that seems a little to complicated for practical use.