       Re: How to simplify this code with variable number of nesting loops?

• To: mathgroup at smc.vnet.net
• Subject: [mg124306] Re: How to simplify this code with variable number of nesting loops?
• From: Sseziwa Mukasa <mukasa at gmail.com>
• Date: Mon, 16 Jan 2012 17:11:55 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• References: <201201150951.EAA19677@smc.vnet.net>

```Do[some computations,Evaluate[Table[{a[k],a[k-1]+1,2 k-1},{k,g}]]

On Jan 15, 2012, at 4:51 AM, Rex <aoirex at gmail.com> wrote:

> Considering an array a[i], i=0,1,...,g, where g could be any given
> number, and a=1.
>
>    for a=a+1 to 1 do
>        for a=a+1 to 3 do
>           for a=a+1 to 5 do
>             ......
>              for a[g]=a[g-1]+1 to 2g-1 do
>                ###some computations here###
>
> The problem is that everytime we change the value of g, we need to
> modify the code, those loops above. So this is not a good code.
>
> Any advice would be greatly appreciated.
>

```

• Prev by Date: Re: How to check whether an infinite set is closed under addition?
• Next by Date: Re: NDSolve output without interpolating function
• Previous by thread: How to simplify this code with variable number of nesting loops?
• Next by thread: Re: How to simplify this code with variable number of