A function $f$, to find the position of an integer $j$, within in a vector $x$ (of size $n$).
In the case that the integer $j$, may only occur once in the vector $x$:
The desired function can be composed of a sum $\sum$, and the delta function $\delta$.
Where the delta function is defined as $\quad\delta(a) := \begin{cases}0&a\neq0\\1&a=0\end{cases}$
$$f(x,j) = \sum_{i=1}^ni\delta(x_i-j)$$
(If zero is returned from this function, the vector does not include an element equal to $j$)
$$x=[1,4,5,3], \quad j =3$$
$$f\big([1,4,5,3], 3\big) = 1\delta(x_1-3) + 2\delta(x_2-3) + 3\delta(x_3-3)+ 4\delta(x_4-3)$$
$$=1(0)+2(0)+3(0)+4(1)$$
$$=4$$
In the case that the integer $j$, may occur more than once, and all occurrences are to be found (as a set):
The desired function can be composed of a union $\cup$, and the delta function $\delta$.
$$f(x,j) = \bigcup_{i=1}^ni\delta(x_i-j)\setminus 0$$
(If the empty set is returned from this function, $x$ does not include the element $j$)
$$x = [3,4,5,3], \quad j = 3$$
$$f\big([3,4,5,3], 3\big) = 1\delta(x_1-3) \cup 2\delta(x_2-3) \cup 3\delta(x_3-3) \cup 4\delta(x_4-3)\setminus 0$$
$$= 1(1)\cup2(0)\cup3(0)\cup4(1)\setminus 0$$
$$= \{1,0,4\}\setminus 0$$
$$= \{1,4\}$$