<s>[INST] A function divisible by $p$ I want to ask about what is the intuition for making functions like these


*

*$4^n+2$ is divisible by $3$

*$ 2^{4n+2}+3^{n+2}$ is divisible by $13$
And if so, how can I make my own ones?  Thank you all for your time.
 [/INST] There is a simple explanation using the binomial theorem:
$$
4^n+2 = (3+1)^n+2 = 3a + 1 + 2
$$
and
$$\small
2^{4n+2}+3^{n+2} 
=4 \cdot 16^n + 9 \cdot 3^n
=4 \cdot (13+3)^n + 9 \cdot 3^n
=13a + 4 \cdot 3^n + 9 \cdot 3^n
=13a + 13 \cdot 3^n
$$
</s>