As we learn in high school $\pi$ has infinitely many digits, if we consider any string of digits, it will of course repeat infinitely many times throughout $\pi$.
I would like to consider the first $n$ digits of $\pi$ and ask when will they repeat themselves for the first time. One could make the question of the following kind, for each $n$ (the number of first digits of $\pi$ we are considering) there is an $m$ such that the string of the first $n$ digits reappears for the first time (beginning) at the $m$'th position. Assuming there is no redundancy we have the bound that, at least, $n< m$.
I am interested if there is any well know theorem that can produce an $m$ for any $n$. Since I suppose no such theorem exists, is there at least a bound on $m$ that is known? Something like $m \leq n!+n^2$ (or some other algebraic expression in $n$).
Furthermore, can anything be said about the nature of the function $m(n)$, it is for sure monotony increasing, but is it rising exponentially, polynomially, with some other more exotic function, if so I would really be interested to know what that function is.
Also, would this function be the same for the hexadecimal expression of $\pi$ for example (or any other basis)?
I have $\epsilon$ knowledge of number theory (I mostly do geometry and analysis) so feel free to redirect me to some standard texts if this question seems trivial.
A second more philosophical question, since $\pi$ infinitely many digits we can find a string of numbers somewhere in $\pi$ with any characterisation we like, thus it is often said that somewhere in $\pi$ there is the whole of Shakespeare written in binary. With this said, what prevents us from looking for a string of digits with the characteristic that if it starts at the point $x$ the sting is of length $x$ and is equal to the first $x$ digits of $\pi$. This seems a bit contradictory since it would mean that there is an $x$ after which the digits that occurred up to that point repeat once more before they continue their random descent into the depths of $\pi$.
Anyhow this simply confuses me, and if somebody could elucidate what is the contradiction in the reasoning in this I also think this would be helpful for me.