Question: I would like to solve this problem using the idea of congruence module m, but I have no idea how to start. Could someone help me?

If $n> 0$ and $n$ is not a multiple of $3$, prove that $a = 3^{2n} + 3^n + 1$ is divisible by $13$.

Answer: 
Like [Trig sum: $\tan ^21^\circ+\tan ^22^\circ+\cdots+\tan^2 89^\circ = \text{?}$](https://math.stackexchange.com/questions/951522/trig-sum-tan-21-circ-tan-22-circ-cdots-tan2-89-circ-text/952044#952044),

$$\tan(2n+1)x=\dfrac{\binom{2n+1}1t-\binom{2n+1}1t^3+\cdots+(-1)^n\binom{2n+1}{2n+1}t^{2n+1}}{\binom{2n+1}0-\binom{2n+1}2t^2+\cdots+(-1)^n\binom{2n+1}{2n}t^{2n}}$$

where $t=\tan x$

So, the roots of $$\binom{2n+1}1t-\binom{2n+1}1t^3+\cdots+(-1)^n\binom{2n+1}{2n+1}t^{2n+1}=0$$ i.e., $$t^{2n+1}-\binom{2n+1}{2n-1}t^{2n-1}+\cdots+(-1)^n(2n+1)t=0$$ are $t\_r=\tan\dfrac{r\pi}{2n+1}; r=0,\pm1,\pm2,\cdots,\pm n$

As $r=0\implies \tan\dfrac{r\pi}{2n+1}=0$, the roots of $$t^{2n}-\binom{2n+1}{2n-1}t^{2n-2}+\cdots+(-1)^n(2n+1)=0$$ are $t\_r=\tan\dfrac{r\pi}{2n+1}; r=\pm1,\pm2,\cdots,\pm n$

Writing $t\_r^2=p\_r,$

the roots of $$p^n-\binom{2n+1}{2n-1}p^{n-1}+\cdots+(-1)^n(2n+1)=0$$ are $p\_r=\tan^2\dfrac{r\pi}{2n+1}; r=1,2,\cdots, n$

Use [Vieta](https://mathworld.wolfram.com/VietasFormulas.html)'s [formula](https://artofproblemsolving.com/wiki/index.php/Vieta%27s_Formulas)
$$=∑\_{=1}^8 tan^2(\frac{}{17})=136$$

$$b=\prod\_{=1}^8 tan^2(\frac{}{17})= 17$$

$$\frac{a}{b}=\frac{136}{17}=8$$

This results can be calculated by hand.

$${Tan[\frac{}{17}]^2, Tan[(2\frac{}{17}]^2, Tan[(3 \frac{}{17}]^2, 
 Tan[(4 \frac{}{17}]^2, Cot[(7 \frac{}{34}]^2, Cot[(5 \frac{}{34}]^2, 
 Cot[(3 \frac{}{34}]^2, Cot[\frac{}{34}]^2}$$

$${0.0349437, 0.15008, 0.383376, 0.831052, 1.75354, 4.03315, 12.3527, \
116.461}$$

This confirms the formulas by [@sangchul-lee](https://math.stackexchange.com/users/9340/sangchul-lee): [Cauchys proof of the Basel lemma](https://en.wikipedia.org/wiki/Basel_problem#Cauchy%27s_proof) but with the figures calculated.