I'm working through Cutland's Computability. Problem 4.4.5 says:
Show that for each $m$ there is a total ($m+1$)-ary computable function $s^m$ such that for all $n$, $$\phi_{e}^{(m+n)} (\textbf{x},\textbf{y}) \simeq \phi_{s^{m}(e,\textbf{x})}^{(n)}(\textbf{y})$$ where $\textbf{x},\textbf{y}$ are $m,n$ tuples.
It also wants me to show that $s^m$ is primitive recursive.
Now the s-m-n theorem states the existence of a primitive recursive $s^m_n$ such that: $$\phi_{e}^{(m+n)} (\textbf{x},\textbf{y}) \simeq \phi_{s^{m}_{n}(e,\textbf{x})}^{(n)}(\textbf{y})$$ which is significant because for any given $n$ we can write a program that effectively shifts the $n$-tuple $\textbf{y}$ right by $m$, inserts $\textbf{x}$, and runs the program encoded by $e$ on this new input $\textbf{x},\textbf{y}$.
But the problem wants me to find some general $s^m$ that will work regardless of the input size $n$. A hint is given, along the lines of: "Use the fact that $\rho(P_e)$, the maximum space accessed by the $e$-th program, is independent of $n$, and that the output depends only on what's inside the registers $1,2,3, ... , \rho({P_e})$ to begin with."
I think the idea is to simply shift every single block used by the program ($1, 2, ... \rho(P_e)$) up by $m$ and inject $\textbf{n}$ in the style of the proof of s-m-n theorem. But this requires actually finding this value $\rho(P_e)$, and I'm not sure if that's doable, primitive recursively at least. It feels like I would need unbounded search for that, making it not primitive recursive. Am I on the right track here?