(Disclaimer: apologies for any incorrect usage of mathematical terminology throughout this question.)
In modern mathematical notation, a variable with a subscript can represent a couple of different concepts relating to the notion of index.
For example, we can define an integer sequence such as the triangle numbers as:
$$T_n = \frac{n(n+1)}{2}$$
Or, we can write an infinite series as:
$$\sum_{i=1}^\infty a_i = a_1+a_2+a_3+\ldots$$
And we can label the elements of a matrix or vector like so:
$$ \mathbf{A} = \begin{bmatrix} a_{11} & a_{12} & a_{13}\\ a_{21} & a_{22} & a_{23}\\ a_{31} & a_{32} & a_{33} \end{bmatrix} , \mathbf{v} = \begin{bmatrix} v_1\\ v_2\\ v_3 \end{bmatrix} $$
But, when did this notation first arrive in mathematics? I've been trying to track down the origins of where this notation comes from through various sources, to no avail. The closest place I've come to an answer was through the book A History of Mathematical Notations, by Florian Cajori. One interpretation of the book may hint that they seem to have emerged around the time determinants were beginning to be studied, before the modern day invention of matrices, possibly by Leibniz? However, this is just from my reading, and the book doesn't acknowledge this directly, or make any note of it. And they could have very easily originated from later or earlier than this. Is there an original field of maths they come from, that their use proliferated out from?