  We use properties of modular forms to prove the following extension of the
Ramanujan-Mordell formula, \begin{align*}
z^{k-j}z_p^{j}=&\frac{p_{\chi}^{k-j}-1}{p_{\chi}^{k}-1}F_p(k,j;\tau)+
\frac{p_{\chi}^{k}-p_{\chi}^{k-j}}{p_{\chi}^{k}-1}F_p(k,j;p\tau)+z^{k}
A_p(k,j;\tau), \end{align*} for all $ 1 < k \in \mathbb{n} $, $0 \leq j \leq k$
and $p$ an odd prime. We obtain this result by computing the Fourier series
expansions of modular forms at all cusps of $\Gamma_0(4p)$.
