I am trying to show that the function that takes in a sequence $a = \langle a_0, \cdots, a_{n-1} \rangle $ and an index $i$ and returns $a_i$ for all $i<n$ is representable in $T_E$ (the theory of Enderton's $A_E$ axioms for arithmetic with successor function $S$, multiplication, <, exponentiation, and addition).
Here are my thoughts: To represent this function we can use prime factorizations to code up each $a_i$ as in $2^{a_0+1} \cdot \cdots \cdot prime_{i-1}^{a_{i-1}+1}$ I'm confused as to what specific formula I am trying to prove is, though. Also how should I go about trying to prove a formula like this? Any hints and insights would be much appreciated.