Suppose I have some vectors:
$[1,2,1]$ its length is $3$ wich represents a matrix like $\begin{pmatrix} 1 & 2\\ -1 & 1 \end{pmatrix}$ the complete matrix would have $4$ elements
$[1,2,1,3,4,1]$ its length is $6$ wich represents $\begin{pmatrix} 1& 2& 3\\ -1& 1 & 4\\ -1& -1 &1 \end{pmatrix}$ the complete matrix would have $9$ elements
$[1,2,1,3,4,1,5,6,7,1]$ its length is $10$ wich represents $\begin{pmatrix} 1 & 2& 3& 5\\ -1 &1 & 4& 6\\ -1 &-1 &1 & 7\\ -1 &-1 &-1 &1 \end{pmatrix}$ the complete matrix would have $16$ elements
$[1,2,1,3,4,1,5,6,7,1,8,9,10,11,1]$ its length is $15$ wich represents
$\begin{pmatrix} 1 &2 &3 &5 &8 \\ -1 &1 &4 &6 &9 \\ -1 &-1 &1 &7 &10 \\ -1 &-1 &-1 &1 &11 \\ -1 &-1 &-1 &-1 &-1 \end{pmatrix}$ the complete matrix would have $25$ elements
How do I find a general formula to get all elements of a square matrix from the number of elements in a vector?
So
- $3\to 4$
- $6\to 9$
- $10\to 16$
- $15\to 25$
- etc...
also: How would you know the matrix size $2\times 2$, $3\times 3$,...$n\times n$?