You have made some numerical errors and considered the contribution of $\$4000$
only. Mathematically one can establish an equivalence between the investments
(at the end of $5$ years and at the end of $10$ years) and a series of $120$
monthly constant payments.
Since there are $m=12$ compounding periods per year, the (nominal) annual interest rate $r=4\%=0.04$ indicates a monthly interest
rate $i=\frac{r}{m}=\frac{4}{12}\%=\frac{0.04}{12}$.
The hypothetical investment of $3000$ at the end of $5$ years ($60$ months) will
accumulate interest during $5$ years ($60$ months). Hence it's future value is $$F^{\prime }=3000\left( 1+i\right)^{60}=3000\left( 1+0.04/12\right) ^{60}\approx 3663.0.$$ Adding the second hypothetical investment $F^{\prime \prime }=4000$ yields the total
future value $F=F^{\prime }+F^{\prime \prime }=7663.0$ at the end of $10$
years. Let $A$ (the annuity) denote each monthly payment. The payment at the end of month $k$ increases to a future value of $F_{k}=A(1+i)^{n-k}$ at the end of $n=120$
months. Summing all these $F_{k}$ the resulting geometric series of $n$
payments, whose ratio is $c=1+i$, should be equal to $F$, as a consequence of the equivalence mentioned above. Applying the formula for such a sum, we get
\begin{equation*}
F=\sum_{k=1}^{n}F_{k}=\sum_{k=1}^{n}A(1+i)^{n-k}=\sum_{j=1}^{n}Ac^{j-1}=A
\frac{c^{n}-1}{c-1}=A
\frac{(1+i)^{n}-1}{i}.
\end{equation*}
Numerically we obtain
\begin{equation*}
A=F\frac{i}{(1+i)^{n}-1}=7663.0\frac{\frac{0.04}{12}}{(1+\frac{0.04}{12}
)^{120}-1}\approx 52.04,
\end{equation*}
which agrees with the answer you indicate.