I was reading Wikipedia, and it was given that "all primes are of the form 6k ± 1" (other than 2 and 3), where k = 1,2,3,4,...
Is this statement correct? If yes, can we use this to test if a given number is a prime number? For instance, we can say that 41 is a prime number, since there exists an integer K (K >= 1), such that 6k - 1 = 41 ==> k = 7.
I am confused why this test cannot be used to test if a number is prime?
Thanks, Sekhar
For $k\ge 1$ no prime can be of the form $6k$ (obvious), $6k+2=2(3k+1)$, $6k+3=3(2k+1)$, $6k+4=2(3k+2)$. There remains $6k+1$ and $6k+5=6(k+1)-1$.