[math-fun] harmonic series, Gosper 1974
Gosper 1974 found a nice sum which is equal to H(n) = SUM(k=1..n) 1/k but "converges faster" and also interpolates it for non-integer n. Question: Is there an analogous nice way to handle the "odd harmonic sum" 1/1 + 1/3 + 1/5 + ... + 1/(2n-1) ? -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
On 2015-10-31 17:23, Warren D Smith wrote:
Gosper 1974 found a nice sum which is equal to H(n) = SUM(k=1..n) 1/k but "converges faster" and also interpolates it for non-integer n.
Question: Is there an analogous nice way to handle the "odd harmonic sum" 1/1 + 1/3 + 1/5 + ... + 1/(2n-1) ? Sure, just start n at 1/2 instead of 1. --rwg
Specifically Gosper 1974 found H(x) = -SUM(j=1,2,3...) (1/j) * (j+x)^(-1) * (3*j+x) * binomial(j-x-1, j) / binomial(2j, j) where H(n) = 1 + 1/2 + 1/3 + ... + 1/n. Each summand in Gosper's series is a rational function of x with denominator=j+x and having numerator which is a polynomial(x) of degree=j+1. With a little cleverness, the first N terms in Gosper's series can all be computed in O(N) arithmetic operations. My question was, what if anything is the corresponding formula for 1 + 1/3 + 1/5 + ... + 1/(2*n-1). -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
It also is interesting (?) that Gosper 1974's formula for H(x) can be integrated term by term to get a formula (essentially) for lnGamma(x) which also is a sum that terminates when x>0 is integer, and always converges for all noninteger real x. Unfortunately then each term will involve a logarithm, not just rational operations, and the terms then no longer seem to be anywhere near as efficiently computable(?). -- Warren D. Smith http://RangeVoting.org <-- add your endorsement (by clicking "endorse" as 1st step)
On 2015-10-31 17:39, Warren D Smith wrote:
Specifically Gosper 1974 found
H(x) = -SUM(j=1,2,3...) (1/j) * (j+x)^(-1) * (3*j+x) * binomial(j-x-1, j) / binomial(2j, j)
where
H(n) = 1 + 1/2 + 1/3 + ... + 1/n.
Each summand in Gosper's series is a rational function of x with denominator=j+x and having numerator which is a polynomial(x) of degree=j+1. With a little cleverness, the first N terms in Gosper's series can all be computed in O(N) arithmetic operations.
My question was, what if anything is the corresponding formula for 1 + 1/3 + 1/5 + ... + 1/(2*n-1).
At least two things. E.g., you could subtract the even ones from the bunch. But that's not much of a correspondence. What I suggested was to start n0 at 1/2 instead of 1, 1/(1/2) + 1/(3/2) + 1/(5/2) ... = binomial stuff with n0 = 1/2 instead of 1. But it looks like you'll need to plug in x+1/2 instead of x as well. Gaa, that pre-matrix viewpoint was messy. Tomorrow night I'll try to modernize (a la http://gosper.org/pathi.pdf [1]) it so you'll have a general formula, including 1,4,7,10, or whatever. --rwg Links: ------ [1] http://gosper.org/pathi.pdf
Foo, I was falling asleep. The identity you want is Out[433]= -PolyGamma[0, n0] + PolyGamma[0, n0 + p] == (1/(2 n0 (n0 + p)))* p (1 + 2 n0 + p) HypergeometricPFQ[{1, 1, 1 - p, 4/3 + (2 n0)/3 + p/3, 1 + p}, {3/2, 1 + n0, 1/3 + (2 n0)/3 + p/3, 1 + n0 + p}, 1/4] Check ten terms: In[440]:= FullSimplify[%433 /. p -> 9] Out[440]= True For harmonic #s, n0->1 In[441]:= MapAt[ FullSimplify[#, p \[Element] Integers && p > 0] &, %433 /. n0 -> 1, 1] Out[441]= HarmonicNumber[p] == (1/(2 (1 + p))) p (3 + p) (((1 + p) HypergeometricPFQ[{1, 1, 1 - p, 2 + p/3}, {3/2, 2, 1 + p/3}, 1/4])/p - HypergeometricPFQ[{1, 1 - p, 2 + p/3, 1 + p}, {3/2, 1 + p/3, 2 + p}, 1/4]/p) (Idiot Mathematica gratuitously replaced the 5F4 with two 4F3s.) For your question, In[445]:= FullSimplify[Sum[1/(2 n - 1), {n, p}], p \[Element] Integers && p > 0] Out[445]= 1/2 HarmonicNumber[-(1/2) + p] + Log[2] use n0 ->1/2: In[443]:= Distribute[ 1/2*MapAt[ FullSimplify[#, p \[Element] Integers && p > 0] &, %433 /. n0 -> 1/2, 1], Equal] Out[443]= 1/2 (HarmonicNumber[-(1/2) + p] + Log[4]) == ( p (2 + p) HypergeometricPFQ[{1, 1, 1 - p, 5/3 + p/3, 1 + p}, {3/2, 3/ 2, 2/3 + p/3, 3/2 + p}, 1/4])/(2 (1/2 + p)) For general n0 in matrix terms, In[442]:= MatProd[mats[n] /. k -> 1, {n, n0, \[Infinity]}] == MatProd[mats[k] /. n -> n0, {k, 1, \[Infinity]}] Out[442]= MatProd[{{(n (n + p))/((1 + n) (1 + n + p)), p/(n0 (n0 + p))}, {0, 1}}, {n, n0, \[Infinity]}] == MatProd[{{(k (k - p) (k + p))/(2 (-1 + 2 k) (k + n0) (k + n0 + p)), ( p (-2 + 3 k + 2 n0 + p))/(2 (-1 + 2 k) n0 (n0 + p))}, {0, 1}}, {k, 1, \[Infinity]}] The source matrices are In[430]:= mats[n] Out[430]= {{(n (n + p))/((k + n) (k + n + p)), p/(n0 (n0 + p))}, {0, 1}} and In[431]:= mats[k] Out[431]= {{(k (k - p) (k + p))/(2 (-1 + 2 k) (k + n) (k + n + p)), ( p (-2 + 3 k + 2 n + p))/(2 (-1 + 2 k) n0 (n0 + p))}, {0, 1}} Path invariance check: In[432]:= Simplify[ mats[n].(mats[k] /. n -> n + 1) == mats[k].(mats[n] /. k -> k + 1)] Out[432]= True (The other two legs of the infinite rectangular contour washed out.) --rwg On 2015-11-01 01:37, rwg wrote:
On 2015-10-31 17:39, Warren D Smith wrote:
Specifically Gosper 1974 found
H(x) = -SUM(j=1,2,3...) (1/j) * (j+x)^(-1) * (3*j+x) * binomial(j-x-1, j) / binomial(2j, j)
where
H(n) = 1 + 1/2 + 1/3 + ... + 1/n.
Each summand in Gosper's series is a rational function of x with denominator=j+x and having numerator which is a polynomial(x) of degree=j+1. With a little cleverness, the first N terms in Gosper's series can all be computed in O(N) arithmetic operations.
My question was, what if anything is the corresponding formula for 1 + 1/3 + 1/5 + ... + 1/(2*n-1).
At least two things. E.g., you could subtract the even ones from the bunch. But that's not much of a correspondence. What I suggested was to start n0 at 1/2 instead of 1, 1/(1/2) + 1/(3/2) + 1/(5/2) ... = binomial stuff with n0 = 1/2 instead of 1. But it looks like you'll need to plug in x+1/2 instead of x as well. Gaa, that pre-matrix viewpoint was messy. Tomorrow night I'll try to modernize (a la http://gosper.org/pathi.pdf [1]) it so you'll have a general formula, including 1,4,7,10, or whatever. --rwg
Links: ------ [1] http://gosper.org/pathi.pdf
participants (2)
-
rwg -
Warren D Smith