Re: Puzzled by Sum
- To: mathgroup at smc.vnet.net
- Subject: [mg124615] Re: Puzzled by Sum
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Thu, 26 Jan 2012 03:31:40 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201201251203.HAA05962@smc.vnet.net>
A[i_, j_] := i/j + j/i Clear[F] F[X_] := Sum[A[X - j, j], {j, 1, X - 1}] F[2] 2 Clear[F] F[X_] = Sum[A[X - j, j], {j, 1, X - 1}]; F[2] 2 Bob Hanlon On Wed, Jan 25, 2012 at 7:03 AM, Themis Matsoukas <tmatsoukas at me.com> wrote: > I am trying to define a function F[X] whose argument is the upper limit in a summation: > > A[i_, j_] := i/j + j/i > F[X_] := (Sum[A[i - j, j], {j, 1, i - 1}]) /. i -> X > > but when I evaluate, say F[2], I get > > -2 DifferenceRoot[{\[FormalY],\[FormalN]}\[Function]{(\[FormalN]-2) \[FormalY](\[FormalN])+(3-2 \[FormalN]) \[FormalY](\[FormalN]+1)+(\[FormalN]-1) \[FormalY](\[FormalN]+2)==0,\[FormalY](0)==0,\[FormalY](1)==-(1/2)}][2]-1 > > where the result should have been 2: > > ii = 2; > Sum[A[ii - j, j], {j, 1, ii - 1}] > > 2 > > If I use A[i,j]=i j or other simple functions, everything works as expected. > > Themis > -- Bob Hanlon
- References:
- Puzzled by Sum
- From: Themis Matsoukas <tmatsoukas@me.com>
- Puzzled by Sum