4\pi \Gamma(n) \frac{\sin(n
    \tan^{-1}(\frac{q}{\alpha}))}{\sqrt{(\alpha^2+q^2)^n}}.
    \label{eq:42}
  \end{aligned}$$ we get $$\begin{aligned}
    f_{n_r,\kappa}(q,Z^*) = (N(2\gamma+1)\Gamma(2\gamma))^2 \left(
    2\kappa (\kappa-\gamma) n_r^2\sigma_1 + 4(\kappa-\gamma) \rho n_r
    \sigma_2 +
    \frac{2\kappa}{\kappa+\gamma}\rho^2\sigma_3\right), \label{eq:41}
  \end{aligned}$$ where $$\begin{aligned}
    \sigma_{1}
    &= \sum_{\substack{i=1\\j=1}}^{n_r} {{n_r-1}\choose{i-1}}
    {{n_r-1}\choose{j-1}}
    \frac{\Gamma(i+j+2\gamma)}{\Gamma(2\gamma+i+1)!
    \Gamma(2\gamma+j+1)!} \xi_{i,j}(q,Z^*),
    \\
    \sigma_{2}
    &= \sum_{\substack{i=1\\j=0}}^{n_r} {{n_r-1}\choose{i-1}}
    {{n_r}\choose{j}} \frac{\Gamma(i+j+2\gamma)}{\Gamma(2\gamma+i+1)!
    \Gamma(2\gamma+j)!} \xi_{i,j}(q,Z^*),
    \\
    \sigma_{3}
    &= \sum_{\substack{i=0\\j=0}}^{n_r} {{n_r}\choose{i}}
    {{n_r}\choose{j}}
    \frac{\Gamma(i+j+2\gamma)}{\Gamma(2\gamma+i)!\Gamma(2\gamma+j)!}
    \xi_{i,j}(q,Z^*),
  \end{aligned}$$ and $$\begin{aligned}
    \xi_{i,j}(q,Z^*)
    &= \frac{(-1)^{i+j}}{q} \sin\left((i+j+2\gamma)
    \tan^{-1}\left(\frac{q}{2\chi Z^*}\right)\right) \left(\frac{2 \chi  
    Z^*}{\sqrt{(2\chi Z^*)^2+q^2}}\right)^{i+j+2\gamma}.
  \end{aligned}$$

Solution of the relativistic Thomas-Fermi equation {#sec:solut-relat-tf}
==================================================

In this appendix we describe the solution of the relativistic TF equation [@gilvarry_relativistic_1954]. The equation written in atomic units reads [@waber_relativistic_1975] $$\begin{aligned}
    x^{1/2}\chi''(x) = \chi^{3/2}(x)\left(1 +
    \left(\frac{128}{9\pi^{2}}\right)^{1/3} \frac{Z^{4/3}}{c^{2}}
    \chi'(x) \left(1 - \frac{x
    \chi'(x)}{2\chi(x)}\right)\right)^{3/2}, \label{eq:18}
  \end{aligned}$$

where $x = r / (b Z^{-1/3})$, $b = (9\pi^{2} / 128)^{1/3}$ and the dimensionless self-consistent potential $\chi(x)$ is related to the self-consistent potential of the TF model as $\phi(r) = Z \chi(rZ^{1/3}/b) - \phi_{0}$, with the constant $\phi_{0}$ defined from the normalization. For neutral atoms $\phi_{0}$ equals zero. For ions it is chosen such that the self-consistent potential vanishes not at infinity, but rather at some finite value $x_{c}$. In the nonrelativistic limit, i.e., when the speed of light tends to infinity the relativistic TF equation coincides with its nonrelativistic 