MathGroup Archive 2006

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

Search the Archive

pretty output with HoldForm


I want to get the following output for the series:

(1 - 1/2 - 1/4) + (1/3 - 1/6 - 1/8) + (1/5 - 1/10 - 1/12) + 
  (1/7 - 1/14 - 1/16) . . .

What I did was

kl[n_]:=HoldForm[ 1/(2n+1)-1/(4n+2)-1/(4n+4)]

then I enter eg:

reihe= Sum[kl[n],{n,1,5}]

This works quite good, but the fractions are completely unevaluated
(because of HoldForm, I know) and display as

     1
----------
4 2 + 2

But I want them displayed as

 1
--
10

Is there a way to evaluate parts inside a HoldForm, so that the
fractions are evaluated but not the sums?

Gruss Peter
-- 
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Demostration
  • Next by Date: Re: For Routine to Map Routine
  • Previous by thread: How to explain unexpected behaviour of Fibonacci[]?
  • Next by thread: RE: pretty output with HoldForm