[seqfan] Re: Mathematica's or my err?
Peter
petsie at dordos.net
Tue Apr 27 10:58:58 CEST 2010
Am 24.04.2010 15:23, schrieb David W. Cantrell:
> It's an error present in Mathematica versions 5.1 and 6.0, at least.
>
> I'm not running the most recent version of Mathematica and so I
> checked with Wolfram Alpha. Asked to compute
>
> Sum[(1/i)*Binomial[2n-i-1,i-1],{i,1,n}]
>
> it returns
>
> (-1 + Hypergeometric2F1[1/2 - n, -n, 1 - 2 n, -4])/(2 n)
>
> That seems to be a correct answer, and so I would guess that the
> current version of Mathematica does not have the error you noticed.
>
> David
>
>
Sorry to disappoint you, David:
Mathematica 7 (64bibt-Linux) gives
In[5]:= FullSimplify[(-1 + Hypergeometric2F1[
1/2 - n, -n, 1 - 2*n, -4])/(2*n)]
Out[5]= (-1 + ((1/2)*(1 + Sqrt[5]))^(2*n))/
(2*n)
In[6]:= N[Table[(-1 + ((1/2)*(1 + Sqrt[5]))^
(2*n))/(2*n), {n, 10}]]
Out[6]=
{0.809017,1.46353,2.82405,5.74734,12.1992,26.7497,60.1428,137.875,320.944,756.3}
these are strange rationals :-/
Maple 13 gives me:
> p := simplify(-1+hypergeom([1/2-n, -n], [1-2*n], -4)/(2*n));
n
/3 1 (1/2)\
-2 n + |- + - 5 |
\2 2 /
----------------------
2 n
> evalf(`$`(p, n = 1 .. 10));
0.3090169942, 0.713525490, 1.990711982, 4.872339214, 11.29918692,
25.83307448, 59.21420087, 136.9374714, 319.9999896, 755.3499945
with assumptions Mma returns the sum unevaluated
In[1]:= Assuming[n >= 1 && Element[n,
Integers], FullSimplify[
Sum[(1/i)*Binomial[2*n - i - 1,
i - 1], {i, 1, n}]]]
Out[1]= Sum[Binomial[-1 - i + 2*n, -1 + i]/i,
{i, 1, n}]
with given values for n:
In[2]:= Table[Sum[Binomial[2*n - i - 1, i - 1]/i,{i, 1, n}],{n, 1, 10}]
Out[2]= {1, 3/2, 17/6, 23/4, 61/5, 107/4,421/7, 1103/8, 5777/18, 7563/10}
Maple again:
> p2 := simplify(sum(binomial(2*n-i-1, i-1)/i, i = 1 .. n));
n n
/3 1 (1/2)\ /3 1 (1/2)\
|- - - 5 | + |- + - 5 | - 1
\2 2 / \2 2 /
-------------------------------------
2 n
> simplify([`$`(p2, n = 1 .. 10)]);
[ 3 17 23 61 107 421 1103 5777 7563]
[1, -, --, --, --, ---, ---, ----, ----, ----]
[ 2 6 4 5 4 7 8 18 10 ]
and finally Mathematica avoiding the call to Sum[]:
In[10]:= Apply[Plus, Table[Binomial[2*n - i - 1, i - 1]/i,
{n, 10}, {i, n}], {1}]
Out[10]= {1,3/2,17/6,23/4,61/5,107/4,421/7,1103/8,5777/18,7563/10}
Maxima is wise enough to avoid the thin ice:
Maxima version: 5.21.0
Maxima build date: 9:39 4/22/2010
Host type: x86_64-unknown-linux-gnu
Lisp implementation type: SBCL
Lisp implementation version: 1.0.37
sum(binomial(2*n-i-1,i-1)/i, i, 1, n);
yields simply:
sum(binomial(2*n-i-1,i-1)/i,i,1,n)
Peter
More information about the SeqFan
mailing list