### The Maxima on-line user's manual

Algebra Calculator

#### Create_list

Function: create_list (<form>, <x_1>, <list_1>, ..., <x_n>, <list_n>) Create a list by evaluating <form> with <x_1> bound to each element of <list_1>, and for each such binding bind <x_2> to each element of <list_2>, .... The number of elements in the result will be the product of the number of elements in each list. Each variable <x_i> must actually be a symbol - it will not be evaluated. The list arguments will be evaluated once at the beginning of the iteration.

```          (%i1) create_list(x^i,i,[1,3,7]);
3   7
(%o1)       [x, x , x ]```

With a double iteration:

```          (%i1) create_list([i,j],i,[a,b],j,[e,f,h]);
(%o1) [[a, e], [a, f], [a, h], [b, e], [b, f], [b, h]]```

Instead of <list_i> two args may be supplied each of which should evaluate to a number. These will be the inclusive lower and upper bounds for the iteration.

```          (%i1) create_list([i,j],i,[1,2,3],j,1,i);
(%o1) [[1, 1], [2, 1], [2, 2], [3, 1], [3, 2], [3, 3]]```

Note that the limits or list for the `j` variable can depend on the current value of `i`.

```(%o1)                                true
(%i2) ```

### Related Examples

##### create_list

create_list(2^i-1, i,...

Calculate

##### create_list-mod

f(x):=x^3+15*x^2+29*x+8;

p:[2,3,5,7,11,13,17,1...

create_list([mod(m,p[...

Calculate

##### create_list-imagpart-realpart

create_list([realpart...

create_list([realpar...

Calculate

M:matrix([1,2],[2,4],...

L:lsquares_estimates(...

Calculate

##### create_list-kill-sin

kill(all);

f(x):=sin(x);

create_list(x[i] :-6+...

Calculate

? create_list;

Calculate

##### create_list

create_list(2^i-1, i,...

Calculate

i:1;

m:1;

n:1;

Calculate

i:1;

m:1;

n:1;

Calculate

##### create_list-delta-kron_delta-min-sum

create_list(sum(sum(s...

Calculate