Set of prime integers Let $S$ be a set of primes such that $a,b\in S$ ($a$ and $b$ need not be distinct) implies $ab+4\in S$. Show that $S$ must be empty. (Hint use modulo 7)
I don't have an idea how to use the hint, any further hint will be appreacited
 A: Lets introduce
$$ r\to s$$
as a shorthand for the statement

If there is an integer $a\in S$ with $a>1$ and $a\equiv r\pmod 7$, then there exists an integer $b\in S$ with $b>7$ and $b\equiv s\pmod 7$.

Note that $\to $ is transitive, i.e., $r\to s$ and $s\to t$ imply $r\to t$.
If $a\in S$ with $a>1$ and $a\equiv 1\pmod 7$, then we know $b:=a^2+4\in S$. As $b>7$ and $b\equiv 5\pmod 7$, we conclude
$$ 1\to 5.$$
Aditionally, now $S$ must contain $c=ab+4$, which is $\equiv 2\pmod 7$, and finally, $d:=bc+4\in S$ where $d\equiv 0\pmod 7$. So indirectly, we have
$$\tag11\to 0.$$
By simply taking $b=a^2+4$ for all other remainders modulo $7$ and combining this with $(1)$, we arrive at
$$\begin{matrix}&&&&3& &&&2\\&&&&\downarrow&&&&\downarrow\\0&\to& 4&\to &6&\to &5&\to &1&\to& 0\end{matrix}$$
We conclude that if $S$ contains any integer $>1$, then there exists $a\in S$ with $a>7$ and $a\equiv 0\pmod 7$. But then $a$ is not prime.
A: After seeing the hints I was able to solve the question. I divided it into cases.
case 1: if $b\in\left\{\left.2,5\right\}\right.$ then $b^2+4\equiv1\ mod\ 7$
case 2: if $b\in\left\{\left.0\right\}\right.$ then $b^2+4\equiv4\ mod\ 7$
case 3: if $b\in\left\{\left.1,6\right\}\right.$ then $b^2+4\equiv5\ mod\ 7$
case 4: if $b\in\left\{\left.3,4\right\}\right.$ then $b^2+4\equiv6\ mod\ 7$
It can be shown that by doing, reapted step case $1,2,3$ can be converted into case 4.
for example case $2$: note that ${{(b}^2+4)}^2+4$ is in set $S$ and it equivalnt to  $6 \ mod\ 7 $
and ${{((b}^2+4)}^2+4)(b^2+4)+4$ is also in set S and equivalnt to  $5 \ mod\ 7 $, finally multiplying $6*5+4\equiv6 \mod\ 7$.
So the problem will be equivelant to show that $a\equiv6\ mod\ 7$ for all $a\in\ S$, by using the $ab+4\in\ S$ repeatedly it can be shown that $a\equiv0 \mod\ 7$ thus $7$ divides an element in $S$. which is contridiction. So the set $S$ must be empty.
A: Suppose $p \in S$.
Suppose $p\equiv 1 \pmod 7$ and $p\in S$.  Then $p_2=p^2 +4 \equiv 5 \pmod 7$ is prime and in $S$.  so $p_3 =p_1p_2 + 4\equiv 9\equiv 2\pmod 7$.  So $p_4 = p_3p_2 +4\equiv 2*5+4 \equiv 0 \pmod 7$ is in $S$.  But $7|p_4$ and $p_4$ is prime so $p_4 = p_3p_2 + 4 =7$ so $p_3p_2=3$ but $3$ is primes so that's impossible as $p_3p_2$ are prime so neither are equal to $1$.
So $S$ contains no primes $\pmod 1 \pmod 7$.
suppose $p\equiv 2\pmod 7$.  Then $p_2 = p^2 +4 \equiv 8 \equiv 1 \pmod 7$ which we proved is impossible..
Suppose $p \equiv 3\pmod 7$ then $p_2 = p^2 + 4\equiv 6\pmod 7$.  Then $p_3=pp_2 + 4\equiv 18\equiv 4\pmod 7$.  And $pp_3 + 4\equiv 16 \equiv 2\pmod 7$ which was impossible.
Suppose $p\equiv 4 \pmod 7$. Then $p_2= p^2+4 \equiv 6$ And $p_3=pp_2 + 4 \equiv 28\equiv 0$ so $7|p_3$ so $p_3$ (which is prime) is equal to $7$ and $pp_2 \equiv 3 \pmod 7$ which was impossible two paragraphs up and is still impossible.
Suppose $p\equiv 5 \pmod 7$ then $p_2=p^2 + 4\equiv 29 \equiv 1$.  That's out.
Suppose $p \equiv 6 \pmod 7$ then $p_2 = p^2 + 4 \equiv 5\pmod 7$.  Nope.
So that only leaves $p\equiv 0 \pmod 7$ and as $p$ prime then $7$ is the only element in $S$.  But $7^2 + 4 =53\in S$ which is a contradiction.
so $S$ is empty.
