MathGroup Archive 2010

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

Search the Archive

working with lists


Hi,

I'm not very good at working with lists. May I ask for someone to work 
out an example which has several elements of what I need to do.

What's the best way to write a function f[list] that goes through each 
element of the lest, doubles each element divisible by three and reduces 
each of the following elements by 1. That is


f[{ 1 2 3 5 7}] is { 1 2 6 4 12 }

Many thanks in advance,

Sam


  • Prev by Date: A integral
  • Next by Date: ListAnimate
  • Previous by thread: Re: A integral
  • Next by thread: Re: working with lists