4. Find all prime pairs $(p, q)$ such that
$$
\left(3 p^{q-1}+1\right) \mid\left(11^{p}+17^{p}\right) \text {. }
$$
4. Direct verification shows that there is no solution when $p=2$.

Below, let $p>2$.
Since $N=11^{p}+17^{p} \equiv 4(\bmod 8)$, it follows that $8 \nmid\left(3 p^{q-1}+1\right)$.
Let $r$ be any odd prime factor of $3 p^{q-1}+1$, and let $a \equiv 11 \times(-17)^{-1}(\bmod r)$.
Then $r \mid\left(a^{p}-1\right)$.
Thus, the order of $a$ modulo $r$, $\operatorname{ord}_{r} a$, can only be 1 or $p$.
If $\operatorname{ord}_{r} a=1$, then
$$
0 \equiv a-1 \equiv(11+17)(-17)^{-1}(\bmod r) \text {. }
$$

Hence, $r=7$.
If $\operatorname{ord} a=p$, by Fermat's Little Theorem, we have
$$
p \mid(r-1) \text {. }
$$

Thus, $3 p^{q-1}+1=2^{\alpha} \times 7^{\beta} p_{1}^{\gamma_{1}} p_{2}^{\gamma_{2}} \cdots p_{k}^{\gamma_{k}}$,
where $p_{i} \notin\{2,7\}$, and
$$
p_{i} \equiv 1(\bmod p)(i=1,2, \cdots, k) .
$$

Since $8 \nmid N$, we have $\alpha \leqslant 2$.
Furthermore, if $p=7$, then $\beta=0$;
if $p \neq 7$, then
$$
\begin{array}{l}
\frac{11^{p}+17^{p}}{28}=11^{p-1}-11^{p-2} \times 17+\cdots+17^{p-1} \\
\equiv p \times 4^{p-1}(\bmod 7),
\end{array}
$$

which implies $7^{2} \nmid\left(11^{p}+17^{p}\right)$.
In any case, $\beta \leqslant 1$.
If $q=2$, then equation (1) becomes
$$
3 p+1=2^{\alpha} \times 7^{\beta} p_{1}^{\gamma_{1}} p_{2}^{\gamma_{2}} \cdots p_{k}^{\gamma_{k}} \text {. }
$$

Since $p_{i} \geqslant 2 p+1$, we have $\gamma_{i}=0(i=1,2, \cdots, k)$. But in this case,
$$
3 p+1=2^{\alpha} \times 7^{\beta} \in\{2,7,14,28\},
$$

which has no prime solution except $p=2$, so this case has no solution.
If $q>2$, then $4 \mid\left(3 p^{q-1}+1\right)$, i.e., $\alpha=2$. In this case, the right-hand side of equation (1) is congruent to 4 or 28 modulo $p$, so we must have $p=3$.
Substituting back into the given condition, we get
$$
\left(3^{q}+1\right) 16244 \Rightarrow q=3 \text {. }
$$

In summary, the original problem has only one solution $(p, q)=(3,3)$.