Suppose I have some vector, how can I get a vector containing the nth order interaction terms of its elements? This seems like a simple question but I have not been able to figure out how to do it and have no idea how to google it.
Suppose I have some vector $$\begin{bmatrix}a & b & c \end{bmatrix}$$ and I want the vector with say 2nd order interaction terms, which would be $$\begin{bmatrix}a & b & c & a^2 & b^2 & c^2 & ab & ac & bc\end{bmatrix}$$ Is there some quick way I can do this using simple matrix operations (like elementwise multiplication, kronecker product etc.)? To clarify I want some method that allows me to get a vector with quite high order interaction terms, like 5 or 6, and the elements cannot repeat (I'm aware that if repetition were allowed I could just keep using kronecker products).
 A: Note that product of the original vector $\,\begin{bmatrix}a & b & c\end{bmatrix}\,$ by its transpose on the left gives you all desired 2nd order terms in square matrix:
\begin{align}
\begin{bmatrix}a \\ b \\ c\end{bmatrix} \begin{bmatrix}a & b & c\end{bmatrix} = \begin{bmatrix} a^2 & ab & ac \\ ab & b^2 & bc \\ ac & bc & c^2 \end{bmatrix}
\end{align}
One can improve on the expression above by appending original vector with $1$:
\begin{align}
\begin{bmatrix}1 \\ a \\ b \\ c\end{bmatrix} \begin{bmatrix}1 & a & b & c\end{bmatrix} = \begin{bmatrix} 1 & a & b & c\\ a & a^2 & ab & ac \\ b & ab & b^2 & bc \\ c & ac & bc & c^2 \end{bmatrix}
\end{align}
By rearranging and disregarding redundant entries of resulting matrix one can get desired vector
\begin{bmatrix}a & b & c & a^2 & b^2 & c^2 & ab & ac & bc\end{bmatrix}
A: When absorbing the answer by Vlad, a generalization to for example $(1+a+b+c)^3$ would lead to a tensor eventually: $T_{i,j,k} = r_i r_j r_k$ with $(r_0,r_1,r_2,r_3) = (1,a,b,c)$ and $0 \le i,j,k \le 3$.
But it's easier to do no vector or tensor calculus at all and look at the question as a combinatorial problem. Then we have the following (Delphi Pascal) progam and its output. It can be generalized easily to larger vectors (rij) and more combinations (nested loops).

program suppose;
procedure test;
const
  rij : array[0..3] of char = ('1','a','b','c');
var
  i,j,k : integer;
begin
  for i := 0 to 3 do
    for j := i to 3 do
      for k := j to 3 do
        Writeln(rij[i],rij[j],rij[k]);
end;
begin
  test;
end.

Output:

111
11a
11b
11c
1aa
1ab
1ac
1bb
1bc
1cc
aaa
aab
aac
abb
abc
acc
bbb
bbc
bcc
ccc

It is noticed that one can also evaluate a product like $(1+a+b+c)^3$ while ignoring the numeric coefficients.
