Re: making a list using table but with different increment after a certain number
- To: mathgroup at smc.vnet.net
- Subject: [mg81544] Re: [mg81469] making a list using table but with different increment after a certain number
- From: János <janos.lobb at yale.edu>
- Date: Wed, 26 Sep 2007 21:46:09 -0400 (EDT)
- References: <200709240821.EAA12775@smc.vnet.net>
On Sep 24, 2007, at 4:21 AM, sean_incali wrote: > I can make a list using > > Table[a, {a, 0, 100, 10}] > > gives > > {0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100} > > > But let's say I wanted to make a list that increment in 1 up to 10, > then increment in 10 onwards. > > So that after "tabling" I would get... > > {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, > 100} > > How do I accomplish this? > Here is a newbie approach with just one Table: In[5]:= Union[Flatten[Table[ If[i < 10, {i, 10*i}, 10*i], {i, 0, 10}]]] Out[5]= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100} J=E1nos ---------------------------------------------- Trying to argue with a politician is like lifting up the head of a corpse. (S. Lem: His Master Voice)
- References:
- making a list using table but with different increment after a certain number
- From: sean_incali <sean_incali@yahoo.com>
- making a list using table but with different increment after a certain number