I stumbled upon this equation: $$\exp_a\left\{\sum_{k=1}^n \gcd(k,n)\cos\left(\frac{2\pi k}{n}\right)\right\}\equiv 1\pmod n\tag*{$\big(\forall a\in\mathbb{Z}\land n\in\mathbb{Z}^+\big)$}$$ such that $\exp_a\left\{b\right\} = a^b$ for all $a,b\in\mathbb{R}$ and $e=2.7182818\ldots$ is the natural base. Is this equation true at all? How can it be proven? I tried looking at similar equations, and doing some research and some exploration through memory, the following theorem looks fairly similar:
Fermat's Little Theorem:
$$a^{p-1}\equiv 1\pmod p.\tag*{$\big(\forall a\in\mathbb{Z}$ and prime $p\big)$}$$
However, the modulus is a prime $p$ in this theorem, but in the upmost equation, the modulus is a positive integer $n$. Could I turn this around somehow, or am I not looking in the right direction?
I found this odd equation in images by looking at math equations to set as my desktop background, and I am now sharing this to you in just different notation (as it looks prettier in my opinion). I cannot find the actual image unfortunately, but it and the equation above is nearly identical.
Nota Bene (Please Note): My skill level is not that great when solving/proving such equations...
Thank you in advance.