MathGroup Archive 2000

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

Search the Archive

Re: powersum with a function with variable count of parameters


Klamser wrote:
> 
> Hi,
> 
> how can I write a function f[x_,xi__]=10^x+10^xi, that returns
> f[1,2,3]->10^1+10^2+10 ^3.
> 
> When i use the above definition, I only get
> 
> 10^1+10^2^3
> 
> But I want to get
> 
> 10^1+10^2+10 ^3
> 
> Regrads, Peter

Hi,

f[expos__] := Plus @@ (10^# & /@ {expos})

Regards
  Jens


  • Prev by Date: Re: point inside torus
  • Next by Date: Re: Newbie question
  • Previous by thread: Re: powersum with a function with variable count of parameters
  • Next by thread: RE: powersum with a function with variable count of parameters