MathGroup Archive 1999

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

Search the Archive

Re: Range[imin,imax,di]; was it better in 3.0 than in 4.0 ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg19588] Re: [mg19570] Range[imin,imax,di]; was it better in 3.0 than in 4.0 ?
  • From: BobHanlon at aol.com
  • Date: Sat, 4 Sep 1999 01:34:25 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Ted,

As in your example with Pi and E, Version 4 appears to work if the designated 
step is atomic

Range[a, a + 6m, m] /. m -> 2n

{a, a + 2*n, a + 4*n, a + 6*n, a + 8*n, a + 10*n, a + 12*n}

Alternatively,

NestList[# + 2n &, a, 6]

or, just for laughs,

List  @@ Simplify[(2n)^7 * Pochhammer[a/(2n), 7]]


Bob Hanlon

In a message dated 9/2/99 4:37:42 AM, ErsekTR at navair.navy.mil writes:

>Range[imin,imax,di] had an interesting capability in version 3.0, but the
>capability is gone in version 40.
>
>--------------------------------
>Using version 3.0:
>
>In[1]:=
>Range[a,a+12 n, 2n]
>
>Out[1]=
>{a,a+2 n,a+4 n,a+6 n,a+8 n,a+10 n,a+12 n}
>
>-----------------------------------------------
>
>I thought that was rather nice, but using version 4.0 we get:
>
>
>In[1]:=
>Range[a,a+12 n,2n]
>
>Range::range: Range specification in Range[a,a+12 n,2 n] is not a
>machine-size integer.
>
>Out[1]=
>Range[a,a+12 n,2 n]
>
>
>Now contrary to what the message above suggests, Range doesn't need Integer
>arguments.  Both version 3 and version 4 give the same result in the
>following example.
>
>
>In[2]:=
>Clear[x];
>Range[x- Pi, x+ Pi, E]
>
>Out[2]=
>{-Pi + x, E - Pi + x, 2*E - Pi + x}
>


  • Prev by Date: Results Scaling
  • Next by Date: Re: LaTeX Output
  • Previous by thread: Range[imin,imax,di]; was it better in 3.0 than in 4.0 ?
  • Next by thread: Re: Range[imin,imax,di]; was it better in 3.0 than in 4.0 ?