Find the pH of an amphiprotic salt dissolved in water at room temperature
$$\begin{align}
\mathrm pH &amp;=\mathrm
pK_\mathrm{a1}+\log \frac {[\ce{HA-}]} {[\ce{H2A}]} \\
\mathrm pH &amp;=\mathrm pK_\mathrm{a2}+\log \frac {[\ce{A^2-}]} {[\ce{HA-}]} \\
\mathrm pH &amp;=\frac{\mathrm pK_\mathrm{a1} + pK_\mathrm{a2} +\log \frac {[\ce{A^2-}]} {[\ce{H2A}]}} {2}\\
\end{align}$$

The last equation is the sum of the equation sides, divided by 2. 

We can consider for expected acidic $\mathrm pH$, that we can neglect water dissociation and suppose $\ce{H+}$ is produced and consumed by these 2 reactions:
$$\begin{align}
\ce{HA- + H+ &amp;&lt;=&gt; H2A} \\
\ce{HA-  &amp;&lt;=&gt; H+ + A^2-} \\
\end{align}$$

Therefore:

$$\begin{align}
[\ce{H}]&amp;={[\ce{A^2-}]}-{[\ce{H2A}]} \\
\mathrm pH &amp;=\frac{\mathrm pK_\mathrm{a1} + \mathrm pK_\mathrm{a2} +\log \frac {[\ce{H2A}] + [\ce{H+}] } {[\ce{H2A}]}} {2}\\
\mathrm pH &amp;=\frac{\mathrm pK_\mathrm{a1} + \mathrm pK_\mathrm{a2} +\log \left( 1 + \frac { [\ce{H+}] } {[\ce{H2A}]}\right)}  {2}\\
K_\mathrm{1a}&amp;=\ce{[H+][HA-] /[H2A]} \\
\ce{[H2A]}&amp;=\ce{[H+][HA-]} /K_\mathrm{1a}\\
\mathrm pH &amp;=\frac{\mathrm pK_\mathrm{a1} + \mathrm pK_\mathrm{a2} +\log \left( 1 + \frac { K_\mathrm{1a}} {[\ce{HA-}]}\right)}  {2}\\
\end{align}$$

Therefore, if $\mathrm{p}K_\mathrm{a1}$ is high enough, i.e. if $\ce{H2A}$ is rather a weak acid,
the simplified formula $\mathrm{p}H=(\mathrm{p}K_\mathrm{a1} + \mathrm{p}K_\mathrm{a2})/2$ is right enough. 

If $\mathrm{p}K_\mathrm{a1}=\ce{[HA-]}$, the $\mathrm{p}H$ correction is cca $+0.15 = \log (2)/2$ 

And then we can use this equation to  iterative corrections, with $\ce{[MHA]}$ being concentration of the used acidic  salt. The fraction is the classical formula to calculate ion fraction.

$$\ce{[HA-]}=\ce{[MHA]} \cdot \small
\frac {K_\mathrm{a1}.\ce{[H+]}}
{[\ce{H}]^2+K_\mathrm{a1} \cdot \ce{[H+]} + K_\mathrm{a1} \cdot K_\mathrm{a2}} $$

$$\frac {K_\mathrm{a1}}{\ce{[HA-]}}=
\frac {[\ce{H}]^2+K_\mathrm{a1} \cdot \ce{[H+]} + K_\mathrm{a1} \cdot K_\mathrm{a2}}
{\ce{[MHA]} \cdot \small
\ce{[H+]}}$$

For particular calculation, the first shoot is taking $\mathrm pH$ from the simplified  formula:

$$\begin{align}
\mathrm pH &amp;=\frac{\mathrm pK_\mathrm{a1} + \mathrm pK_\mathrm{a2}}{2}=(1+4)/2=2.5 \\
\end{align}$$

I have realized, the direction of iterations must be reversed, as the formulas lead to divergence. ( It is known mathemathical problem to choose the right iteration with the small derivative $\mathrm{d}f(x)/\mathrm{d}x$.

The simplified equation at the bottom of the post expects  not too acidic or alkaline $\mathrm pH$. It supposes the equilibrium reactions affecting
 $[\ce{H}]$ do not significantly affect ratio of concentrations  $$\frac {[\ce{A^2-}]}{[\ce{H2A}]}$$

As the $\mathrm pH$ is near the both $\mathrm pK_\mathrm a$, it is quite a fair assumption for most cases.

$$\begin{align}
\ce{2 HA- &amp;&lt;=&gt; H2A + A^2-} \\
\frac {[\ce{H2A}]} {[\ce{HA-}]} &amp;=\frac {[\ce{A^2-}]} {[\ce{HA-}]}\\
 [\ce{H2A}] &amp;= [\ce{A^2-}] \\
\mathrm pH &amp;=\frac{\mathrm pK_\mathrm{a1} + \mathrm pK_\mathrm{a2}}{2}  \\
\end{align}$$