Define $$q(n)=3n+1+\frac{1-(-1)^n}{2} \quad, \quad n\in \mathbb N.$$
$$1,5,7,11,13,17,19,23,25,29,31,35,\dots$$
It seems like this formula gives all primes $>3$ (although not just primes of course), which is verified for all $n<1000$. Is it provable or are there counter examples?
Note $\,q(2k) = 6k+1,\ q(2k+1) = 6k+5$ and every prime $\,p>3\,$ has one of those forms, since by division $\, p = 6q+r,\ 0\le r\le 5\,$ and $\,2\mid 6k,\,6k+2,6k+4\,$ and $\, 3\mid 6k+3$