Re: Problem with Infinite products

*To*: mathgroup at smc.vnet.net*Subject*: [mg65398] Re: Problem with Infinite products*From*: Maxim <m.r at inbox.ru>*Date*: Thu, 30 Mar 2006 05:29:50 -0500 (EST)*References*: <dvrbsp$a3a$1@smc.vnet.net> <e035oq$2d8$1@smc.vnet.net> <e05re8$3r5$1@smc.vnet.net> <e08kk8$4b1$1@smc.vnet.net> <e0dp0n$q53$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

On Wed, 29 Mar 2006 10:54:15 +0000 (UTC), Roger Bagula <rlbagulatftn at yahoo.com> wrote: > Maxim Rytin, > Thank you very much for your help! > On that you are probably right, > I picked the default 1/2 to work at Zeta one, > It doesn't work at Zeta[2]. > Thanks for pointing that out. > It still should give a better answer. > I arranged it so it missed a singularity each time. > That got it: I used another "If" and it works: > > f[n_, 1] := If[Mod[Prime[n], 12] - 1 == 0, Prime[n], 0] > f[n_, 2] := If[Mod[Prime[n], 12] - 5 == 0, Prime[n], 0] > f[n_, 3] := If[Mod[Prime[n], 12] - 7 == 0, Prime[n], 0] > f[n_, 4] := If[Mod[Prime[n], 12] - 11 == 0, Prime[n], 0] > zeta[x_, m_] := Product[If[f[n, m] == 0, 1, f[n, m]^(x)/(-1 + f[n, > m]^(x))], {n, 1, Infinity}] > > The results look like the results I got from the sums. > Product values: > baa={1.00734,1.04776,1.02578,1.01143} > error is: > (3/2)*Apply[Times, baa] - Pi^2/6 > -0.00238175 > Sum values at 1000000 terms assuming equal populations: > ebb={1.02912,1.01745,1.0216,1.02518} > (3/2)*Apply[Times, ebb] - Pi^2/6 > 0.0000108624 > > In any case it has been demonstrated that such product function factors > do exit. As far as I know this is a new unique approach to the Zeta > function. You've correctly reproduced the Euler product formula for the zeta function (only you split it into four separate products). Here's one way to improve the accuracy: In[1]:= NProduct[1/(1 - Prime[k]^-2), {k, Infinity}, Method -> Fit, NProductFactors -> 10^4, NProductExtraFactors -> 10^5] - Zeta[2] Out[1]= -7.5461329*^-8 It's interesting to note that Mathematica complains that the argument of Prime isn't integer, but still gives a numerical answer. This means that at some points it first tries evaluating the function with numericized values of k and then reverts to using the exact value. If we add Round, we don't get warnings but the computation takes much longer: In[2]:= Developer`ClearCache[]; NProduct[1/(1 - Prime[k]^-2), {k, Infinity}, Method -> Fit] // Timing Out[3]= {0.141*Second, 1.6435712} In[4]:= Developer`ClearCache[]; NProduct[1/(1 - Prime[Round[k]]^-2), {k, Infinity}, Method -> Fit] // Timing Out[5]= {8.546*Second, 1.6435712} Sometimes this 'numericizing' can be an issue, particularly if expressions of the form k[1] are used as variables and the index is left unchanged in one place and is converted to a machine number in another place: NIntegrate[1, {x[1], 0, 1}, {x[2], 0, x[1]}] This doesn't work (in Mathematica 5.2) because x[1] in the second iterator becomes x[1.], which is treated as a different variable. One way to make it work is to set the attribute NHoldAll: In[6]:= Block[{x}, Attributes[x] = NHoldAll; NIntegrate[1, {x[1], 0, 1}, {x[2], 0, x[1]}]] Out[6]= 0.5 Maxim Rytin m.r at inbox.ru