Can every prime (greater than $5$) be expressed in the form $30m+n$? Let
$$
T = \{ 1, 7 , 11 , 13 , 17 , 19 , 23, 29 \}
$$
Can every prime $p > 5$ be expressed in the form $30m+n$, where $m\geq 0$ and $$n is a element of set $T$?

For example 
Prime number $37$ is expressed as $30\times 1+7$ where $7$ is a element of set.
I did check untill $1000$ to find counterexample for this statement. But i can't find it.
If it is true, please help me to prove it.
 A: Yes, prime $\,p>5\,\Rightarrow\,p\,$ is coprime to $\,2,3,5\,$ so $\,p\,$ is coprime to  $\,2\cdot 3\cdot 5 = 30,\,$ thus so too is its remainder $\ n = (p\bmod 30),\,$ hence $\,n\,$ lies in one of the $\,\phi(3) = 8\,$ residue classes that you listed.
Remark $\ 30$ is the largest integer with this property, i.e. every positive integer $> 30$ has at least one composite totative. A proof is in this answer.
A: Suppose $T$ was the set of all numbers from 0 to 29. Every prime number can be expressed as $30m + n:n \in T$. In fact, every integer can be expressed this way. However, there are certain values of $n$ for which you'll never get a prime. For example, $30m + 15$ will never be prime, since this number will be divisible by 3 and 5. Hence we can safely omit 15 from $T$.
This is true for all numbers except for those in the $T$ you gave. All of these (except 1) share no factors with 30, that is, they are coprime with 30. The conclusion is that yes, your proposition is true.
A: Suppose that a counterexample does exist. This $n \not\in T$, $0 < n < 30$. If $n = 2$, then $30m + n$ is not prime because it is even. If $n = 3$, then $30m + n$ is not prime because this number is divisible by $3$, which you can verify thus: $$\frac{30m + 3}{3} = 10m + 1.$$ In this way, we can rule out the even possibilities for $n$, as well as the multiples of $3$ and $5$. This leaves us $1, 7, 11, 13, 17, 19, 23, 29$, which you've already discovered.
A: Can be also written as $T=\{1,7,11,13\}$
$(30m \pm n)$ for $m \le 1$
and $(n)$ for $m=0$
you can prove it by drawing a sieve similar to Eratosthenes one but with 30 numbers for every row, and remove the columns which is divisible by 2,3,5
you will at last get the columns which in in $T$ set.
