MathGroup Archive 2013

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

Search the Archive

Re: List:{1}, {2,3},{4,5,6}....

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129407] Re: List:{1}, {2,3},{4,5,6}....
  • From: "Moses, Peter J. C." <mows at mopar.freeserve.co.uk>
  • Date: Fri, 11 Jan 2013 22:23:24 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <kcntv4$f8h$1@smc.vnet.net>

Hi "hknetman",

Here is another way ...

Range[#]+Accumulate[#-1]&[Range[5]]

Best regards,
Peter.


Peter. J. C. Moses.
Moparmatic Co.
1154 Evesham Road.
Astwood Bank.
Redditch.
Worcs.
B96 6DT.
England.
Tel & Fax 01527 892413.
52°15.713? N. 001°56.256? W

"hknetman" <hknetman at hotmail.com> wrote in message 
news:kcntv4$f8h$1 at smc.vnet.net...
>I use the command
> list = Table[i + 1, {n, 1, 5}, {i, n (n - 1)/2, n (n - 1)/2 + n - 1}]
> to get the following result:
> {{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 15}}
>
> Is there any better method?
>
> Thanks a lot.
> 




  • Prev by Date: Re: wrong result when computing a definite integral
  • Next by Date: Re: Plotting objective function in FindMinimum
  • Previous by thread: Re: List:{1}, {2,3},{4,5,6}....
  • Next by thread: Re: List:{1}, {2,3},{4,5,6}....