MathGroup Archive 2003

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

Search the Archive

RE: Simple Question -- Incrementing All Elemnts in A list by 1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg44320] RE: [mg44290] Simple Question -- Incrementing All Elemnts in A list by 1
  • From: "Harvey P. Dale" <hpd1 at nyu.edu>
  • Date: Wed, 5 Nov 2003 10:00:50 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Thiery:

            This should do it:

(#+1)&/@{2,3,4,45,98}

            Best,

            Harvey

Harvey P. Dale
University Professor of Philanthropy and the Law
Director, National Center on Philanthropy and the Law
New York University School of Law
Room 206A
110 West 3rd Street
New York, N.Y. 10012-1074
tel: 212-998-6161
fax: 212-995-3149



-----Original Message-----
From: Thiery Balser [mailto:thiery.balser at gmx.net]
To: mathgroup at smc.vnet.net
Subject: [mg44320] [mg44290] Simple Question -- Incrementing All Elemnts in A list
by 1



Hi,



I'm sort of stuck.



I would like to have all elements in a list incremted by a given number

without defining a supplementary function.



What I've done so far is:



incFunc[n_]:=n+1;

Map[incFunc,{2,3,4,45,98}]



which is all fine. It is only that I'm looking for a solution _without_

defining the mentioned function incFunc.





Thanks in advance,



Thiery







  • Prev by Date: Re: Simple Question -- Incrementing All Elemnts in A list by 1
  • Next by Date: Re: two different results for Sum[Log[n]/n...
  • Previous by thread: Re: Simple Question -- Incrementing All Elemnts in A list by 1
  • Next by thread: Re: Simple Question -- Incrementing All Elemnts in A list by 1