Writing f' is the same as writing f^{\prime}; for double primes, it is f'' and so on. The code ^' is wrong.
Besides, there are also wrong (not just useless) braces in your code:
\begin{equation} \label{eq:Vpi(s)}
V^{\pi}(s) = \sum_{a}\pi(s,a) \sum_{s'}
\mathcal{P}^{a}_{ss'} \bigl[\mathcal{R}^{a}_{ss'} + \gamma V^{\pi}(s') \bigr]
\end{equation}
Use \biggl[ and \biggr] instead of the unqualified \bigg in order to give the brackets their correct nature of delimiters. However, the size is too big: \bigl[ and \bigr] are sufficient.
It's also better to use semantic names for the labels, rather than eq24 as the number might change during preparation of the document. If you use \label{eq:Vpi(s)} (or whatever you prefer), the references will not depend on the actual number.
See the code below if you really want staggered subscripts and superscripts.
\documentclass{article}
\usepackage{amsmath}
\usepackage{tensor}
\begin{document}
Your formula (with the main fixes)
\begin{equation} \label{eq24}
\begin{split}
V^{\pi}(s) = {\sum_{a}\pi(s,a)}
\sum_{s'} \mathcal{P}{{^a}_{{ss}'}} \bigg[{\mathcal{R}{{^a}_{{ss}'}}} + \gamma {V^{\pi}}(s') \bigg]
\end{split}
\end{equation}
The same with the suggested fixes
\begin{equation} \label{eq:Vpi(s)}
V^{\pi}(s) = \sum_{a}\pi(s,a) \sum_{s'}
\mathcal{P}^{a}_{ss'} \bigl[\mathcal{R}^{a}_{ss'} + \gamma V^{\pi}(s') \bigr]
\end{equation}
If you want staggered superscripts and subscripts, it's better to use tensor
\begin{equation} \label{eq:Vpi(s)mod}
V^{\pi}(s) = \sum_{a}\pi(s,a) \sum_{s'}
\tensor{\mathcal{P}}{^{a}_{ss'}}
\bigl[\tensor{\mathcal{R}}{^{a}_{ss'}} + \gamma V^{\pi}(s') \bigr]
\end{equation}
\end{document}

s'(and the like) instead ofs^'– Bernard Sep 23 '19 at 08:25\bigg[and\bigg]should be\biggl[and\biggr]respectively. Also\mathcal{P}{{^a}_{{ss}^'}}should be more simply\mathcal{P}^{a}_{ss'}– egreg Sep 23 '19 at 08:46split? Do you think thatsplitmeans you can have the content/input split across multiple lines? – Werner Sep 23 '19 at 20:13