# Sum of squared arctangents

I discovered a curious identity $$\small{2939\arctan^2 2+450\arctan^2 8+84\arctan^2 13+330\arctan^2 18+147\arctan^2 38=\\1250\arctan^2 3+252\arctan^2 4+360\arctan^2 5+870\arctan^2 7+210\arctan^2 21+210\arctan^2 47.}\tag{\diamond}$$ Is there a simpler identity of this kind? All coefficients must be positive integers and all arguments of squared arctangents must be distinct integers $$\ge2$$.

Is there a systematic way to find all identities of this kind? Is there an infinite number of them?

• LLL algorithm can be used. – Count Iblis Mar 2 at 1:28
• Just out of curiosity : how did you find it ? – Claude Leibovici Mar 2 at 5:34
• FindIntegerNullVector in Mathematica to find a conjecture, and then proved it by expressing arctangents of larger arguments as linear combination of smaller, and expanding squares. I did not find a simpler identity, but it might be because its coefficients are too large. – Vladimir Reshetnikov Mar 2 at 7:20

What does "simpler" mean? Fewer terms? Smaller Coefficients? Smaller arguments?

The identity you wrote down is easy to verify using the fact that

$$4 \arctan(n) = \log(1 + n i)^2 + \log(1 - n i )^2 - 2 \log(1 + n i) \log(1 - ni).$$

In order to find identities, you want to consider a collection of $$n$$ such that the Gaussian integers $$1 \pm n i$$ all have a fixed collection of Gaussian prime divisors, or equivalently $$n^2 + 1$$ has a small number of prime factors. For example, all the arguments in your formula have $$n^2 + 1$$ divisible only by the primes $$2$$, $$5$$, $$13$$, $$17$$. The complete collection of integers with this property is

$$1, 2, 3, 4, 5, 7, 8, 13, 18, 21, 38, 47, 57, 239, 268.$$

Ignoring the term $$1$$ (I'm not sure why you want to ignore this), the space of values $$\arctan(n)^2$$ for the $$14$$ values of $$n$$ generates a vector space over $$\mathbf{Q}$$ of dimension at most $$10$$, and so any $$11$$ terms are linearly dependent over the field $$\mathbf{Q}$$.

To prove the dimension is at leat $$10$$ would require various algebraic independence results for logarithms which are probably not known, the point being that one has quadratic terms in logarithms which are beyond the usual transcendence results.

Suppose you look for $$n$$ so that $$n^2 + 1$$ is only divisible by the primes $$2$$, $$5$$, and $$13$$. Then the only such $$n$$ are

$$1, 2, 3, 5, 7, 8, 18, 57, 239.$$

Ignoring $$1$$, there are $$8$$ numbers, which generate a vector space of dimension at most $$7$$, and so any $$8$$ terms give a linear relation. The one with smallest coefficients is probably given by taking all $$9$$ terms, namely

$$21 \arctan(5)^2 + 34 \arctan(7)^2 + 5 \arctan(8)^2 = 75 \arctan(2)^2 + \arctan(3)^2 + 5 \arctan(18)^2 + 5 \arctan(57)^2 + \arctan(239)^2.$$

Of course, the appearance of $$239$$ will not be a huge surprise to arctan fans.

So there are certainly identities with smaller coefficients and a smaller number of terms. There are probably not identies where the exponents are smaller than $$47$$, however, because there is not enough cancellation in terms of the factors of $$n^2 + 1$$.

As to whether there are infinitely many identities, that's a slightly sticky problem. If you fix a set of prime numbers $$S$$ (necessarily in this case of the form $$2$$ or $$1 \pmod 4$$), then there are only finitely many integers $$n$$ such that $$n^2 + 1$$ is only divisible by primes in $$S$$ (a non-trivial but standard number theory exercise). However, it's quite unclear exactly how many there should be. For example, if you include the next prime $$29$$ as well, then you seem to get

$$2, 3, 4, 5, 7, 8, 12, 13, 17, 18, 21, 38, 41, 47, 57, 70, 99, 157, 239, 268, 307$$

There are new relations here, the simplest one found by LLL turning out to have all coefficients under $$10$$, namely

$$\sum a_i \log(b_i)^2 = 0,$$ where $$(a_i)$$ and $$(b_i)$$ are given by

$$\{-9, -8, 1, -3, -8, -1, 2, 3, -4, 1, -2, 3, -3, -1, 7, 7, -7, 7, 7, 0, 0\},$$ $$\{2, 3, 4, 5, 7, 8, 12, 13, 17, 18, 21, 38, 41, 47, 57, 70, 99, 157, 239, 268, 307\}.$$ respectively.

I suspect that there are probably infinitely many more relations but that proving it will depend on subtle (and probably open) number theoretical problems concerning the number of integers of the form $$n^2 + 1$$ with restricted prime factors.