# Interesting patterns in $f(k,n)=k\pi-\sum\limits_{x=1}^n\tan^{-1}\left(\frac1{\sqrt[k]x}\right)$

Motivation: If we draw a right-angled triangle $$A_1$$ with sides $$1,1$$ then the hypotenuse is of length $$\sqrt2$$. If we draw a right-angled triangle $$A_2$$ with sides $$\sqrt2,1$$ attached to $$A_1$$ then the hypotenuse is of length $$\sqrt3$$. If we draw a right-angled triangle $$A_3$$ with sides $$\sqrt3,1$$ attached to $$A_2$$ then the hypotenuse is of length $$\sqrt4$$. If we keep on doing this, what is the largest value of $$n$$ such that none of the areas of $$A_1,\cdots,A_n$$ overlap?

Consider the bivariate function $$f(k,n)=k\pi-\sum_{x=1}^n\tan^{-1}\left(\frac1{\sqrt[k]x}\right)$$ where $$k,n$$ are positive integers.

For every $$k$$, there is a largest value $$n$$ (call it $$n^+$$) such that $$f(k,n)$$ is minimised yet remaining non-negative. The results are tabulated below. \begin{align}\begin{array}{c|c|c}k&f(k,n^+)&n^+\\\hline 1& 0.0358 &16\\ 2& 0.1545 &16\\ 3& 0.1000 &20\\ 4& 0.1239 &24\\ 5& 0.1863 &28\\ 6& 0.2670 &32\\ 7& 0.3557 &36\\ 8& 0.4475 &40\\ 9& 0.5394 &44\\\\\\\\\\\\ \end{array}\quad\quad\quad\begin{array}{c|c|c}k&f(k,n^+)&n^+\\\hline 10& 0.0344 &49\\ 11& 0.1097 &53\\ 12& 0.1844 &57\\ 13& 0.2580 &61\\ 14& 0.3300 &65\\ 15& 0.4004 &69\\ 16& 0.4690 &73\\ 17& 0.5357 &77\\ 18& 0.6007 &81\\ 19& 0.6640 &85\\\\\\\\\\ \end{array}\quad\quad\quad\begin{array}{c|c|c}k&f(k,n^+)&n^+\\\hline 20& 0.0516 &90\\ 21& 0.1072 &94\\ 22& 0.1616 &98\\ 23& 0.2147 &102\\ 24& 0.2666 &106\\ 25& 0.3173 &110\\ 26& 0.3669 &114\\ 27& 0.4154 &118\\ 28& 0.4628 &122\\ 29& 0.5091 &126\\ 30& 0.5544 &130\\ 31& 0.5988 &134\\ 32& 0.6423 &138\\ 33& 0.6848 &142 \end{array}\end{align}

We can see several interesting patterns.

1. It seems that $$n^+$$ increases by $$4$$ for each increment of $$k$$, but at certain values, it increases by $$5$$.

2. In each table, $$f(k,n^+)$$ seems to be monotonically increasing.

3. As $$k$$ increases, the length of the table increases (from left to right)

Each table (from left to right) represents a cycle. Therefore we have $$(n^+)_1=9,\quad (n^+)_2=10,\quad (n^+)_3=14$$ since the first cycle has length $$9$$, the second cycle has length $$10$$ and the third cycle has length $$14$$.

Questions

1. Why does $$n^+$$ increase by $$4$$ so regularly in each cycle?

2. Is it true that $$f(k,n^+)$$ is monotonically increasing in each cycle?

3. Is it true that as $$\ell$$ increases, $$(n^+)_\ell$$ increases?

If $$A=\{A_1,\cdots,A_n\}$$ then $$|A|=16$$ since $$k=2$$.

• The case $k=2$ is famous, because the construction (the spiral of Theodorus) approaches the Archimedean spiral and so the distance between the winding approximates $\pi$. I'm sure the OP knows this, but I think this information makes the question more interesting – Yuriy S Aug 7 '19 at 8:38
• I don't know if it helps any, but we can express the function as: $$f(k,n)= \sum_{q=0}^\infty \frac{(-1)^q}{2q+1} \left(4k- H_n^{\left((2q+1)/k \right)} \right)$$ Where $H_n^{(r)}$ is generalized harmonic number. This series is alternating, so not immediately useful for proving inequalities, but there still might be a way, using some general relations for harmonic numbers/polygamma functions – Yuriy S Aug 7 '19 at 18:14
• Just as random thoughts (can't prove at the moment -- it's 2AM, brain is shutting down), but maybe that helps: 1. Since $n$ grows linearly as $k$ grows, $\sqrt[k]{x \leq n}$ tends to $1$, thus arctangents tend to $\pi/4$, which explains why do we see $4$ so often and why $n$ continues growing linearly. My guess: cycles will become longer and longer as arctangents will be closer to $\pi/4$. 2. $n$ certainly should grow as you make $k$ bigger since $k\pi$ becomes bigger and all arctangents -- smaller. 3. My guess is "yes" as I explained earlier. – guest Aug 10 '19 at 22:44
• @guest: for 2. the arctangents get bigger too. – metamorphy Aug 11 '19 at 19:24

This is a partial answer (with a bit of rigor). I'll denote your $$n^+=n^+(k)$$ simply by $$n_k$$.
1. A crude but easy estimate is $$4k\leqslant n_k\leqslant(4k)^{k/(k-1)}$$ (for $$k>1$$). The lower bound is trivial; on the other hand, for $$0\leqslant t\leqslant 1$$ we have $$\tan^{-1}t \geqslant\pi t/4$$ (concavity), giving the upper bound: $$0\leqslant f(k,n_k)\leqslant k\pi-n_k\tan^{-1}n_k^{-1/k}\leqslant(4k-n_k^{1-1/k})\pi/4.$$ As a consequence, we get $$\color{blue}{\lim\limits_{k\to\infty}n_k/k=4}$$. To refine it, write $$f(k,n)=\Big(k-\frac{n}{4}\Big)\pi+\sum_{x=1}^{n}g\Big(\frac{\ln x}{k}\Big),\quad g(t)=\frac{\pi}{4}-\tan^{-1}e^{-t};$$ we have $$t-t^3/6\leqslant{}$$$$2g(t)$$$${}\leqslant t$$ for $$t\geqslant 0$$. Together with $$\underbrace{\int_1^n\ln x\,dx}_{=n\ln n-n+1}\leqslant\sum_{x=1}^{n}\ln x\leqslant\underbrace{\int_1^{n+1}\ln x\,dx}_{=(n+1)\ln(n+1)-n},$$ we obtain $$\begin{gather}0\leqslant f(k,n_k)\leqslant f_k:=\Big(k-\frac{n_k}{4}\Big)\pi+\frac{(n_k+1)\ln(n_k+1)-n_k}{2k};\\0>f(k,n_k+1)\geqslant f_k-\frac{\pi}{4}-\frac{n_k+1}{12}\Big(\frac{\ln(n_k+1)}{k}\Big)^3,\end{gather}$$ which gives $$\lim\limits_{k\to\infty}f_k/\ln k=0$$ and hence $$\color{blue}{\lim_{k\to\infty}\frac{n_k-4k}{\ln k}=\frac{8}{\pi}}.\label{asymplim}\tag{*}$$
2. Using the estimates found above, \begin{align}d_k&:=f(k+1,n_k+4)-f(k,n_k)=\sum_{x=1}^{n_k+4}g\Big(\frac{\ln x}{k+1}\Big)-\sum_{x=1}^{n_k}g\Big(\frac{\ln x}{k}\Big)\\&\geqslant\frac{1}{2}\sum_{x=n_k+1}^{n_k+4}\frac{\ln x}{k+1}-\frac{1}{2}\sum_{x=1}^{n_k}\Big(\frac{\ln x}{k}-\frac{\ln x}{k+1}\Big)-\frac{1}{12}\sum_{x=1}^{n_k+4}\Big(\frac{\ln x}{k+1}\Big)^3\\&\geqslant\frac{2\ln(n_k+1)}{k+1}-\frac{(n_k+1)\ln(n_k+1)-n_k}{2k(k+1)}-\frac{n_k+4}{12}\Big(\frac{\ln(n_k+4)}{k+1}\Big)^3\\&=\frac{n_k}{2k(k+1)}-\frac{n_k-4k+1}{2k(k+1)}\ln(n_k+1)-\frac{n_k+4}{12}\Big(\frac{\ln(n_k+4)}{k+1}\Big)^3.\end{align} This implies $$\liminf\limits_{k\to\infty}kd_k\geqslant 2$$, hence $$\color{blue}{d_k>0}$$ for all sufficiently large $$k$$. I think one can give an explicit lower bound on $$k$$ for this to hold, and check the claim for smaller values of $$k>2$$.
3. The limit $$\eqref{asymplim}$$ above shows that the sequence $$k_1, such that $$n_{k_\ell}>n_{k_\ell-1}+4$$, is infinite, and suggests $$\color{blue}{\lim\limits_{\ell\to\infty}k_{\ell+1}/k_\ell=e^{\pi/8}}$$. The first $$20$$ values of $$k_\ell$$ seem to agree: $$\begin{array}{r|r|r}\ell&k_\ell&\approx k_\ell/k_{\ell-1}\\\hline 1&10& \\ 2&20&2.00000000 \\ 3&34&1.70000000 \\ 4&56&1.64705882 \\ 5&90&1.60714286 \\ 6&141&1.56666667 \\ 7&218&1.54609929 \\ 8&333&1.52752294 \\ 9&505&1.51651652 \\ 10&760&1.50495050\end{array}\qquad\qquad\begin{array}{r|r|r}\ell&k_\ell&\approx k_\ell/k_{\ell-1}\\\hline 11&1141&1.50131579 \\ 12&1705&1.49430324 \\ 13&2543&1.49149560 \\ 14&3785&1.48839953 \\ 15&5627&1.48665786 \\ 16&8357&1.48516083 \\ 17&12402&1.48402537 \\ 18&18395&1.48322851 \\ 19&27273&1.48263115 \\ 20&40424&1.48219851\end{array}\\e^{\pi/8}\approx 1.48097267$$
• The last value of $f(k,n_k)$ in each cycle also seems to be monotonically increasing, and seems to converge. Furthermore, as $k\to\infty$, the first value of $f(k,n_k)$ in each cycle seems to tend to $0$. – TheSimpliFire Aug 12 '19 at 9:18