# Why is this product equal to zero, when the correct result is 2+GoldenRatio?

Consider the following product

$$\prod _{k=2}^{\infty } \frac{1}{1-\frac{\left(\frac{1}{2} \left(\sqrt{5}-1\right)\right)^k}{1-\left(\frac{1}{2} \left(\sqrt{5}-1\right)\right)^{2 k}}}$$

Mathematica (all tested versions) calculated it as zero, but the correct result is 2 + GoldenRatio.

 Product[1/(1 - ((Sqrt[5]-1)/2)^k/(1 - ((Sqrt[5]-1)/2)^(2*k))), {k, 2, Infinity}]
(* 0 *)


But the numerical calculation is

 N[Product[1/(1 - ((Sqrt[5]-1)/2)^k/(1 - ((Sqrt[5]-1)/2)^(2*k))), {k, 2, 1000}], 20]
(* 3.6180339887498948482 *)


which is the correct result

 N[2 + GoldenRatio, 20]
(* 3.6180339887498948482 *)

• You can use s=NProduct[1/(1 - ((Sqrt[5] - 1)/2)^ k/(1 - ((Sqrt[5] - 1)/2)^(2*k))), {k, 2, Infinity}] // RootApproximant. Use s /. Sqrt[5] -> 2 GoldeRatio - 1 // Simplify to put it in the form you want. Sep 22 '19 at 17:46
• Seems like a bug to me. Have you reported it to WRI? Sep 23 '19 at 0:35
• Michael, my experience is as follows. In 2012 I reported one bug (see mathematica.stackexchange.com/questions/84077/…). It has not been fixed for several years. Only when I mentioned it in this forum (in 2015), it was relatively quickly fixed. I am therefore skeptical about this. Sep 23 '19 at 7:05

The problem seems to be that the function

f[n_, x_:(Sqrt[5]-1)/2] := Product[
1 / (1 - x^k/(1 - x^(2*k))), {k, 2, n}];


when called with f[n, x] returns

-((-1 + x + x^2)*QPochhammer[-1, x, 1 + n]*QPochhammer[x, x, n])/
(2*(-1 + x^2)*QPochhammer[-2/(1 + Sqrt[5]), x, 1 + n]*
QPochhammer[(1 + Sqrt[5])/2, x, 1 + n])


which is a product/quotient of QPochhammer symbols with (-1+x+x^2) in the numerator and QPochhammer[(1+Sqrt[5])/2,x,1+n] in the denominator. However, when this is expanded out, and n is a positive integer, then 1 - x(1+Sqrt[5])/2 appears as a factor and when x is (Sqrt[5]-1)/2 this factor is 0 and both the numerator and denominator have 0 factors. Mathematica apparently doesn't recognize the hidden 0 in the denominator. What this means is that the use of a QPochhammer quotient is valid generically but it is not valid if division by zero is introduced which is precisely the case here. It is somehwat similar to replacing 1+x with (1-x^2)/(1-x) which is valid unless x==1

Just for your information, if we define the functions

F[n_] := Fibonacci[n]; L[n_] := LucasL[n];
a[n_] := 2 + L[2 n + 2] - F[n + 4] - (L[2 - n] + F[n + 1])/2;
b[n_] := 1 + F[2 n + 1] - F[n + 2] - (F[2 - n] + F[n + 1])/2;


then f[n] F[2 n + 2] == a[n] + Sqrt[5] b[n].