Multiplication of sequences

Description:

Generate a new sequence by duplicating members of a sequence.

Syntax:

A*k  or

k*A

Note:

The function generates a new sequence by multiplying the given sequence by an integer k, that is - duplicating members of the sequence for k times.

If k<=0, then return an empty sequence.

Parameter:

A

A sequence

k

A positive integer

Return value:

A new sequence generated by duplicating the members of a given sequence for multiple times.

Example:

 

A

 

1

=[1,2,3]*3

[1,2,3, 1,2,3, 1,2,3]

2

=3*[1,2,3]

[1,2,3, 1,2,3, 1,2,3]

3

=[1,2,3]*0

[]

Related function:

Difference between sequences

Union of sequences

Concatenation of sequences

Alignment arithmetic operations

cmp()