Search code examples
maple

Compact declared in maple


In maple, I have declared

var := {m[1], m[2], m[3], 
m[4], m[5], m[6], 
m[7], m[8], m[9], 
m[10], m[11], m[12], 
m[13], m[14], m[15],
m[16], m[17], m[18], 
m[19],m[20], m[21], 
m[22], m[23], m[24],
m[25], m[26], m[27],
m[28], m[29], m[30],
m[31], m[32], m[33],
m[34], m[35], m[36],
m[37], m[38], m[39],
m[40]};

But it is too long. How to declare shorter ?


Solution

  • You could use the seq command to create a sequence for the m[i] terms:

    var := { seq( m[i], i = 1..40 ) };