TITLE: Show that every prime $p>3$ is either of the form $6n+1$ or of the form $6n+5$
QUESTION [9 upvotes]: Show that every prime $p>3$ is either of the form $6n+1$ or of the form $6n+5$, where $n=0,1,2, \dots$

REPLY [2 votes]: Indeed, all primes greater than $3$ are in the form of $6n-1$ and $6n+1$. I've studied this a few years ago. Here's a basic visual proof of that using a sieve and isolation method that I used:
First, list down all the numbers in 6 columns:
$$\begin{array}{c|c|c|c|c|c}
1&2&3&4&5&6\\
7&8&9&10&11&12\\
13&14&15&16&17&18\\
\end{array}$$(the list will be infinite)
Then, we cross out the column of $2, 3, 4$, and $6$ as they are all composite. so we are just left out with two columns of $1$ and $5$. Using Algebraic progression with a difference of $6$, Column 1 generates the prime path of $$6n+1\quad[7,13,19,\ldots,\infty]$$ and column 5 generates the prime path of $$6n-1\quad[5,11,17,23,\ldots,\infty]$$
Thus, by isolation and sieve method, we can see that all primes must be in the form $6n-1$/$6n+1$.