Daily Mathematics / Solutions
Solutions for 22 October 2026
Two cards went out that day: a hard definite integral and an original Putnam-style problem. Try each one first; the solutions are folded away below.
Integral
A logarithm of x coth x against a Cauchy weight

Evaluate in closed form.
\[\int_{0}^{\infty}\frac{\ln\!\left(\pi x\coth \pi x\right)}{1+4x^{2}}\,dx\]Show the solution
Write \(I\) for the integral. Since \(t\coth t\ge 1\) for \(t>0\), the integrand is nonnegative, it behaves like \(\pi^{2}x^{2}/3\) near \(0\) and like \(\ln(\pi x)/(4x^{2})\) at infinity, so \(I\) converges. The function \(\ln(\pi x\coth\pi x)\) has no usable antiderivative, and expanding \(\coth\pi x=1+2\sum_{k\ge1}e^{-2\pi kx}\) only produces the logarithm of a series, which goes nowhere. The right move is to read \(\pi x\coth\pi x\) as a quotient of two infinite products, because the logarithm of a product is a sum.
Step 1: two product expansions. The zeros of \(\sinh \pi z\) are \(z=ik\) and those of \(\cosh\pi z\) are \(z=i(k-\tfrac12)\), \(k\in\mathbb{Z}\), and the Euler (Weierstrass) products read
\[\frac{\sinh\pi x}{\pi x}=\prod_{k\ge1}\Bigl(1+\frac{x^{2}}{k^{2}}\Bigr),\qquad \cosh\pi x=\prod_{k\ge1}\Bigl(1+\frac{x^{2}}{(k-\frac12)^{2}}\Bigr).\](Both follow from \(\sin\pi z=\pi z\prod(1-z^{2}/k^{2})\) and \(\cos\pi z=\prod(1-z^{2}/(k-\frac12)^{2})\) at \(z=ix\).) Hence \(\pi x\coth\pi x=\cosh\pi x\big/\bigl(\sinh(\pi x)/(\pi x)\bigr)\) and
\[\ln(\pi x\coth\pi x)=\sum_{k\ge1}u_{k}(x),\qquad u_{k}(x)=\ln\Bigl(1+\frac{x^{2}}{(k-\frac12)^{2}}\Bigr)-\ln\Bigl(1+\frac{x^{2}}{k^{2}}\Bigr).\]Each \(u_{k}\) is nonnegative because \(k-\tfrac12<k\). By Tonelli's theorem we may therefore integrate term by term against the positive weight \(1/(1+4x^{2})\).
Step 2: one term. For \(c>0\) put \(J(c)=\displaystyle\int_{0}^{\infty}\frac{\ln(1+x^{2}/c^{2})}{1+4x^{2}}\,dx\). Differentiating under the integral sign (dominated convergence on \([c_{0},\infty)\) for each \(c_{0}>0\)) and using \(\frac{\partial}{\partial c}\ln(1+x^{2}/c^{2})=-\frac{2x^{2}}{c(c^{2}+x^{2})}\),
\[J'(c)=-\frac{2}{c}\int_{0}^{\infty}\frac{x^{2}\,dx}{(x^{2}+c^{2})(1+4x^{2})}=-\frac{1}{2c}\int_{0}^{\infty}\frac{x^{2}\,dx}{(x^{2}+c^{2})(x^{2}+\frac14)}=-\frac{1}{2c}\cdot\frac{\pi}{2(c+\frac12)}.\]Here we used \(\int_{0}^{\infty}\frac{x^{2}\,dx}{(x^{2}+a^{2})(x^{2}+b^{2})}=\frac{\pi}{2(a+b)}\), which follows from partial fractions. Thus \(J'(c)=-\frac{\pi}{2}\bigl(\frac1c-\frac{1}{c+\frac12}\bigr)\), and since \(J(c)\to0\) as \(c\to\infty\),
\[J(c)=\frac{\pi}{2}\ln\Bigl(1+\frac{1}{2c}\Bigr).\]Step 3: the Wallis product appears. Applying Step 2 with \(c=k-\tfrac12\) and with \(c=k\),
\[\int_{0}^{\infty}\frac{u_{k}(x)}{1+4x^{2}}\,dx=\frac{\pi}{2}\Bigl[\ln\frac{2k}{2k-1}-\ln\frac{2k+1}{2k}\Bigr]=\frac{\pi}{2}\ln\frac{4k^{2}}{4k^{2}-1}.\]Summing over \(k\) and using Wallis's product \(\prod_{k\ge1}\frac{4k^{2}}{4k^{2}-1}=\frac{\pi}{2}\),
\[I=\frac{\pi}{2}\ln\prod_{k\ge1}\frac{4k^{2}}{4k^{2}-1}=\frac{\pi}{2}\ln\frac{\pi}{2}.\]The same computation with the weight \(1/(x^{2}+b^{2})\) gives \(\frac{\pi}{b}\ln\frac{\Gamma(\frac12)\Gamma(1+b)}{\Gamma(\frac12+b)}\), and \(b=\tfrac12\) is the case where the Gamma quotient collapses to Wallis's \(\pi/2\).
Numerical check. After the substitution \(x=t/(1-t)\), composite Gauss-Legendre quadrature (100 nodes per panel, panels clustered geometrically towards \(t=1\), with the explicit tail beyond \(x=10^{14}\) added) gives \(0.709344454712778\), agreeing with \(\frac{\pi}{2}\ln\frac{\pi}{2}=0.709344454712778\ldots\) to within \(10^{-15}\).
Competition problem
A take-away game with a square-root cap

Players alternately take stones from one pile: from \(m\) stones one must take \(k\), where \(k\) is an integer with \(1\le k\le\sqrt{m}\). A stuck player loses. Let \(0=n_{0}<n_{1}<\cdots\) be the pile sizes that are second-player wins. For each \(d\ge 2\), how many \(j\) satisfy \(n_{j+1}-n_{j}=d\)?
Show the solution
Call a pile size a P-position if the player to move loses with best play (these are the \(n_{j}\)) and an N-position otherwise. Computing the first few by hand gives \(0,2,5,8,12,17,22,28,34,41,48,56,65,\dots\), with gaps \(2,3,3,4,5,5,6,6,7,7,8,9,9,\dots\). The natural guess, that every gap from \(3\) on occurs exactly twice, is wrong: the gaps \(4\), \(8\), \(16\) occur once. A proof has to explain where the powers of \(2\) come from, and analysing the game tree directly does not; what works is to turn the game into a recurrence and then follow one integer offset.
Step 1: the game becomes a recurrence. From \(m\) stones the reachable sizes are exactly the integers in \([m-\lfloor\sqrt m\rfloor,\,m-1]\), a block of consecutive integers ending just below \(m\). A size is a P-position exactly when no move reaches a P-position. Suppose \(n_{j}\) is a P-position and no P-position lies strictly between \(n_{j}\) and \(m\). Every size in \((n_{j},m)\) is then an N-position, and any smaller P-position can only be reached if \(n_{j}\) can, because the reachable set is an interval ending at \(m-1\). So \(m\) is a P-position if and only if \(n_{j}\) is out of reach, that is, \(m-n_{j}>\lfloor\sqrt m\rfloor\). Hence
\[n_{j+1}=n_{j}+g(n_{j}),\qquad g(n)=\min\{d\ge1:\ d>\lfloor\sqrt{n+d}\rfloor\}.\]Step 2: a formula for the gap. For an integer \(d\), \(d>\lfloor x\rfloor\) is equivalent to \(d>x\), so \(d>\lfloor\sqrt{n+d}\rfloor\iff d^{2}>n+d\iff d(d-1)>n\). Since \(d(d-1)\) increases with \(d\ge1\), \(g(n)=d\) exactly when \(n\) lies in
\[I_{d}=\bigl[(d-1)(d-2),\ d(d-1)\bigr),\qquad d\ge2.\]These intervals partition the nonnegative integers, and \(I_{d}\) has length \(2(d-1)\). So the number of \(j\) with \(n_{j+1}-n_{j}=d\) is \(c_{d}\), the number of P-positions lying in \(I_{d}\).
Step 3: one or two P-positions per block. Inside \(I_{d}\) consecutive P-positions differ by exactly \(d\), and \(2(d-1)<2d\), so \(c_{d}\le2\). Also \(c_{d}\ge1\): if \(a\) is the last P-position in \(I_{d-1}\), then \(a+(d-1)\) lies beyond \(I_{d-1}\) and satisfies \(a+(d-1)\le(d-1)(d-2)-1+(d-1)<d(d-1)\), so it lies in \(I_{d}\) (and \(n_{0}=0\in I_{2}\)). Let \(a_{d}\) be the first P-position in \(I_{d}\) and put \(r_{d}=a_{d}-(d-1)(d-2)\). We show by induction that \(0\le r_{d}\le d-2\). Then \(a_{d}+d\in I_{d}\) iff \(r_{d}+d<2(d-1)\), so
\[c_{d}=2\ \text{ if } r_{d}\le d-3,\qquad c_{d}=1\ \text{ if } r_{d}=d-2.\]The next P-position is \(a_{d}+c_{d}d\), the first one in \(I_{d+1}\), so \(r_{d+1}=r_{d}+c_{d}d-2(d-1)\).
Step 4: the slack and the powers of two. Put \(s_{d}=d-2-r_{d}\ge0\). The recursion becomes: if \(s_{d}>0\) then \(c_{d}=2\) and \(s_{d+1}=s_{d}-1\); if \(s_{d}=0\) then \(c_{d}=1\) and \(s_{d+1}=d-1\). In both cases \(0\le s_{d+1}\le (d+1)-2\), which closes the induction. The start is \(a_{2}=0\), so \(r_{2}=0\) and \(s_{2}=0\). Now if \(s_{2^{k}}=0\), then \(s_{2^{k}+1}=2^{k}-1\), and \(s\) then drops by one at each step, staying positive until it reaches \(0\) exactly at \(d=2^{k}+1+(2^{k}-1)=2^{k+1}\). By induction on \(k\), \(s_{d}=0\) precisely when \(d\) is a power of \(2\).
Conclusion. The gap \(d\) occurs exactly once when \(d\) is a power of \(2\) and exactly twice otherwise. Unwinding the offsets also gives the P-positions explicitly: with \(2^{e}\) the least power of \(2\) that is at least \(d\), they are \(d^{2}-d-2^{e}\) for every \(d\ge2\), together with \(d^{2}-2^{e}\) for every \(d\ge3\) that is not a power of \(2\).
Computational check. The P-positions were computed directly from the game up to \(10^{6}\) stones and matched the explicit description above exactly. The gap counts were tabulated for every gap that occurs below \(2\cdot10^{5}\) stones: each power of \(2\) occurs once, every other \(d\ge2\) twice.