Appearance
A description of the challenge was also provided along with the source code. Please have a look at cotan.pdf.
The challenge name refers to the fact that we're somehow `emulating' the cotangent function in a finite field
cotangent
In real numbers, this is effectively finding given , however, the challenge is in
Consider how cotangent is related to the complex expressions:
Performing the substitution , we get and
in
Plugging in the values from the challenge, we have and (where )
Now we need to somehow express in . Since , we simply need to find a number such that , which is trivial for (here ). Both solutions would work here.
solving for , and
\begin{align*} u&=(2+i)/(2-i)\\\\ c&=i(u^n+1)/(u^n-1)\\\\ u^n&=(c+i)/(c-i)\\\\ \end{align*}
Now it's just a discrete log problem, which takes some time to solve (15mins on my old and broken laptop)