MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica 8 does not like Sum[1/k,{k,n,10}]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg130771] Re: Mathematica 8 does not like Sum[1/k,{k,n,10}]
  • From: Bob Hanlon <hanlonr357 at gmail.com>
  • Date: Mon, 13 May 2013 03:48:43 -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>

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.
>
>




  • Prev by Date: Mathamatica / Calculus Consultant Sought
  • Next by Date: Re: Work on Basic Mathematica Stephen!
  • Previous by thread: Mathematica 8 does not like Sum[1/k,{k,n,10}]
  • Next by thread: Re: Mathematica 8 does not like Sum[1/k,{k,n,10}]