Coding challenge

Write some code to prove that $\sum_{k=1}^n\tan^{-1}\frac{1}{2k^2}=\tan^{-1}\frac{n}{n+1}$. Note the right-hand side depends only on $n$, the numbers of terms in your sum on the left-hand side. (From Andreescu, p. 28.)

Type your code here:


Lua reference

See your results here: