# Numerical coincidence? Why is sum(x^(k^2)) = sum(x^((k+1/2)^2)) for x = 0.8?

A well-known formula for the logarithm is given by

$$\log x = -\frac{\pi}{AGM(a^2,b^2)}, \qquad x < 1$$

where AGM is the arithmetic-geometric mean, and $a$ and $b$ are given by

$$a = \sum_{k\in\mathbb{Z}}x^{k^2}, \qquad b = \sum_{k\in\mathbb{Z}}x^{(k+1/2)^2};$$

Or, equivalently,

$$a = 1 + 2x + 2x^4 + 2x^9 + 2x^{16} + 2x^{25} + \dots$$ and $$b = 2x^{1/4} + 2x^{9/4} + 2x^{25/4} + 2x^{49/4} + \dots$$

Why does it happen that $a = b$ occurs when $x = 0.8$?

The two values $a(0.8)$ and $b(0.8)$ appear "deceivingly" equal, but they actually are not!

Other "near-miss" values include $$0<\theta_3(0,0.9)-\theta_2(0,0.9)<0.5\times 10^{-39}.$$

Let $f(x)=\theta_3(0,x)-\theta_2(0,x)$. The graph of $f(x)$, for values $0<x<1$ shows a global minimum at $x_*$ near $x=0.9$ (of course $f(x_*)>0$, still) and also a local maximum for some $0.9<x^*<1$. It would be really interesting to figure out these numbers, especially $x_*$. In any case, there are two values of $x$ in the range $0.8<x<1$ for which $$\theta_3'(0,x)=\theta_2'(0,x).$$

By the way, can someone post the graph for $y=f(x)$? It would be a nice documentation for the discussion and analysis here.

• I'm afraid you are misusing the big O notation (though in here it is kinda clear what you mean): if you really meant big O there, then it would just mean that this difference is smaller than $C\cdot 10^{-39}$ for some constant $C$, which of course tells us absolutely nothing. This is more of a nitpick though. – Wojowu Oct 8 '16 at 9:01

$$\sum_{k \in \mathbb Z} x^{k^2} = \theta_3(0,x)$$ while $$\sum_{k \in \mathbb Z} x^{(k+1/2)^2} = \theta_2(0,x)$$ where $\theta_2$ and $\theta_3$ are Jacobi theta functions. The difference $$\theta_2(0,0.8) - \theta_3(0,0.8) \approx 9.280378636257491074676461535977 \times 10^{-19}$$ according to Maple.

EDIT: The difference $$\theta_3(0,x) - \theta_2(0,x) = \sum_{j \in \mathbb Z} (-1)^j x^{(j/2)^2} =\theta_3(\pi/2, x^{1/4})$$ The Poisson summation formula gives us the identity $$\theta_3(\pi/2, e^{-t^2}) = \frac{\sqrt{\pi}}{t} \theta_2(0, e^{-\pi^2/t^2})$$ and for $t \to 0+$, this goes to $0$ very rapidly: $$\theta_3(\pi/2, e^{-t^2}) \sim \frac{2 \sqrt{\pi}}{t} e^{-\pi^2/(4 t^2)}$$ i.e. $$\theta_3(0,x) - \theta_2(0,x) \sim \frac{4 \sqrt{\pi}}{\sqrt{\ln(1/x)}} \exp\left(-\frac{\pi^2}{\ln(1/x)}\right)$$ For $x = 0.8$, the right side above is extremely close to the value I gave for $\theta_2(0,0.8) - \theta_3(0,0.8)$ (all digits shown match).

• The difference is even smaller for 0.9. It looks like my original question was pretty stupid: wolframalpha.com/input/?i=theta2(0,0.9)-theta3(0,0.9) – Zazzle Oct 7 '16 at 20:49
• On the contrary: it is connected to some interesting properties of the theta functions. – Robert Israel Oct 7 '16 at 21:29
• There's something just slightly funny about saying "all digits shown match" when "all digits shown match" was precisely the original problem! :-) – wchargin Oct 7 '16 at 23:07