Re: Mathematica 8 does not like Sum[1/k,{k,n,10}]
- To: mathgroup at smc.vnet.net
- Subject: [mg130780] Re: Mathematica 8 does not like Sum[1/k,{k,n,10}]
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Tue, 14 May 2013 03:16:08 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <20130512072916.5997769C9@smc.vnet.net>
Alternatively,
$Version
"8.0 for Mac OS X x86 (64-bit) (October 5, 2011)"
Clear[f]
f[n_Integer?(0 < # < 9 &)] = Sum[1/k, {k, 8}] - Sum[1/k, {k, n - 1}]
761/280 - HarmonicNumber[-1 + n]
Table[f[n] == Sum[1/k, {k, n, 8}], {n, 0, 9}] // Quiet
{f[0] == ComplexInfinity, True, True, True, True, True, True, True, True,
f[9] == 0}
Bob Hanlon
On Mon, May 13, 2013 at 3:48 AM, Bob Hanlon <hanlonr357 at gmail.com> wrote:
>
> Without giving n a specific value in your definition, Mathematica has no
> way of knowing that you intend n to be an integer in the range [1, 8].
>
>
> $Version
>
>
> "8.0 for Mac OS X x86 (64-bit) (October 5, 2011)"
>
>
> f1[n_Integer?(0 < # < 9 &)] :=
> Sum[1/k, {k, n, 8}]
>
>
> f2[n_Integer?(0 < # < 9 &)] :=
> Sum[1/k, {k, 8, n, -1}]
>
>
> Table[f1[n] == f2[n] == Sum[1/k, {k, n, 8}], {n, 0, 9}] // Quiet
>
>
> {f1[0] == f2[0] ==
> ComplexInfinity, True, True, True, True, True, True, True, True,
> f1[9] == f2[9] == 0}
>
>
>
> Bob Hanlon
>
>
>
>
> On Sun, May 12, 2013 at 3:29 AM, valvola <g.resta at iit.cnr.it> wrote:
>
> > Apparently, Mathematica 8 does not like the simple expression:
> >
> > Clear[k,n]; Sum[1/k,{k,n,8}]
> >
> > The result is two errors:
> > Power::infy: "Infinite expression 1/0 encountered."
> >
> > and a large expression
> > DifferenceRoot[
> > Function[{\[FormalY], \[FormalN]}, {\[FormalN] \
> > \[FormalY][\[FormalN]] + .... etc.etc.
> >
> > By the way, the similar Sum[1/k, {k, 8, n}] works fine.
> >
> > ????
> > g.
> >
> >
>
>
>
- References:
- Mathematica 8 does not like Sum[1/k,{k,n,10}]
- From: valvola <g.resta@iit.cnr.it>
- Mathematica 8 does not like Sum[1/k,{k,n,10}]