Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #13136 > unrolled thread
| Started by | Dana DeLouis <dana01@icloud.com> |
|---|---|
| First post | 2013-01-14 05:01 +0000 |
| Last post | 2013-01-14 05:01 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: List:{1}, {2,3},{4,5,6}.... Dana DeLouis <dana01@icloud.com> - 2013-01-14 05:01 +0000
| From | Dana DeLouis <dana01@icloud.com> |
|---|---|
| Date | 2013-01-14 05:01 +0000 |
| Subject | Re: List:{1}, {2,3},{4,5,6}.... |
| Message-ID | <kd03eo$6ds$1@smc.vnet.net> |
> to get the following result:
> {{1}, {2, 3}, {4, 5, 6}, {7, 8, 9, 10}, {11, 12, 13, 14, 15}}
Hi. If you don't actually need to generate a large list, here's another interesting idea:
Series[(-1-2 (-1+x) x)/(-1+x)^3,{x,0,10}] //Normal
1+x+2 x^2+4 x^3+7 x^4+11 x^5+16 x^6+22 x^7+29 x^8+37 x^9+46 x^10
If you just need the fifth item in the list, then with 11 x^5,
that list starts with 11, and has a length of 5.
ie. {11, 12, 13, 14, 15}
Another variation might be just the list of starting values, with the length based on it's position.
z=CoefficientList[Series[(-1+x-x^2)/(-1+x)^3,{x,0,10}],x]
{1,2,4,7,11,16,22,29,37,46,56}
(ie 6th item starts with 16, and has length 6. ie 16=8521)
The 1000th item starts with 499501.
Coefficient[Series[(-1-2 (-1+x) x)/(-1+x)^3,{x,0,1000}],x,1000] // Timing
{0.004363, 499501}
Just thought it interesting:
= = = = = = = = = =
HTH :>)
Dana DeLouis
Mac & Mathematica 8
= = = = = = = = = =
On Jan 10, 9:38 pm, hknetman <hknet...@hotmail.com> wrote:
> 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.
Re: List:{1}, {2,3},{4,5,6}....
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web