Almost-converses to the AM-GM inequality Let us consider the Arithmetic Mean -- Geometric Mean inequality for nonnegative real numbers: 
$$ GM := (a_1 a_2 \ldots a_n)^{1/n} \le \frac{1}{n} \left( a_1 + a_2 + \ldots + a_n \right) =: AM. $$
It is known that the converse inequality ($\ge$) holds if and only if all the $a_i$'s are the same. 
Therefore, we can expect that if the $a_i$'s are almost the same, then a converse inequality almost holds. 
For example, we may look for an inequality of the form $AM \le GM + f(\Delta,n)$ where $\Delta$ is the ratio between $\max_i a_i$ and $\min_i a_i$, but this is just one possibility. 
Are there any natural ways to formalize the above intuition? 
 A: Here is an old result of  Siegel that   is related to your question.
Set
$$ s=s(a_1,\dotsc, a_n)=\frac{1}{n} (a_1+\cdots +a_n), $$
$$ p= p(a_1,\dotsc, a_n)=a_1\cdots a_n, $$
$$ \Delta= \Delta(a_1,\dotsc, a_n)=\prod_{i,j}(a_i-a_j)^2. $$
The AM-GM inequality reads
$$\frac{s^n}{p}\geq 1. $$
Observe that $s$ is homogeneous of degree $1$, $p$ is homogeneous of degree $n$ and $\Delta$ is homogeneous of degree $n(n-1)$ in the variables  $a_j$. In particular,  the ratio
$$ R= \frac{p^{n-1}}{\Delta} $$
is homogeneous of degree $0$.
Note that $\Delta=0$ when two of the numbers $a_j$ are equal.   In particular, large $\Delta $ would mean that   the  numbers are "far from being equal". Equivalently, the larger $\Delta$ is,  the more "dispersed"  are the numbers $a_j$.
One can ask how dispersed can the numbers $a_j$ be given that  $s$ and $p$ are fixed. In other words we ask to find
$$\max \Delta(a_1,\dotsc, a_n)$$
given that
$$s(a_1,\dotsc, a_n)=s_0,\;\;p(a_1,\dotsc, a_n)=p_0. $$
This  constrained maximum exists  and  can be described    explicitly as the discriminant of a certain Laguerre  polynomial.   I will denote it by $\Delta_\max(s_0,p_0)$.
I will set
$$ \rho=\rho(s_0,p_0)= \frac{p_0^{n-1}}{\Delta_\max(s_0,p_0)}. $$
Then there exists  an  explicit but very complicated strictly decreasing  continuous function
$$ F_n: (0,\infty)\to (1,\infty) $$
such that
$$\lim_{t\to\infty} F_n(t)=1, $$
$$\frac{s(a_1,\dotsc,a_n)^n}{p(a_1,\dotsc,a_n)}= \frac{s_0^n}{p_0}= F_n(\rho)= F_n\left( \frac{p_0^{n-1}}{\Delta_\max(s_0,p_0)}\right) \geq F_n\left(\frac{p(a_1,\dotsc, a_n)^{n-1}}{\Delta(a_1,\dotsc, a_n)}\right). $$
Here are a few more things things about the function  $F_n$. It is described as a composition $Q_n\circ P_n^{-1}$, were
$$ Q_n: (0,\infty)\to (1,\infty) $$
is a strictly decreasing, very explicit rational function and
$$P_n:(0,\infty)\to (0,\infty) $$
is a very explicit  and strictly increasing  polynomial such that $P_n(0)=0$.  This implies the sharper inequality
$$  s(a_1, \dotsc, a_n)^n \geq F_n\left(\frac{p(a_1,\dotsc, a_n)^{n-1}}{\Delta(a_1,\dotsc, a_n)}\right)p(a_1,\dotsc, a_n), $$
with equality iff
$$ \Delta(a_1,\dotsc,a_n)=\Delta_\max(s,p). $$
For more details see  Sec. 8.6 of the beautiful book Special Functions by G.E. Andrews, R. Askey, R. Roy.
A: Proposition 1 in this paper might be what you are looking for.
A: Upper and lower bounds on on the difference between the arithmetic and geometric means were given in the recent paper available at Bull. Austr. Math. Soc. or arXiv; these bounds are exact in their own terms. Also, see bibliography there. 
In particular, the mentioned upper bound on $\frac1n\,\sum_1^n a_i-(a_1\cdots a_n)^{1/n}$  is 
$$\max\Big[\frac2n\sum_1^n(b_i-\overline b)^2,\frac1n\sum_1^n(b_i-b_\min)^2\Big],  
$$
where $b_i:=\sqrt{a_i}$, $\overline b:=\frac1n\,\sum_1^n b_i$, and $b_\min:=\min_{1\le i\le n} b_i$. 
A: The left and right sides are both continuous functions.
A: Power mean inequality can give many bounds for the difference between AM and GM. Most simple is 
$$AM - GM \leq \max_i a_i - \min_i a_i.$$
Another bound is 
$$AM - GM \leq AM - HM = \frac{a_1+\dots+a_n}{n} - \frac{n}{1/a_1 + \dots + 1/a_n}$$
etc.
See http://en.wikipedia.org/wiki/Generalized_mean#Generalized_mean_inequality
A: It's not precisely what you asked about, but this paper by Gluskin and Milman shows that, for "most" sequences $a_1, \dotsc, a_n$, the AM-GM inequality can be reversed up to a multiplicative constant.  The paper contains a number of observations which come closer to directly addressing your question.
A: A result due to Cartwright and Field gives an upper bound for $AM-GM$ of the form you seek:
$$AM-GM \le \frac{1}{2n \min a_i} \sum_{i=1}^{n} (a_i-AM)^2$$
A very naive computation shows that the RHS is $\le \frac{1}{2 \min a_i} (\max a_i - \min a_i)^2$. 
This estimate is already better than the suggested naive bound $\max a_i - \min a_i$ when $\max a_i$ and $\min a_i$ are relatively close, specifically: when $\max a_i \le 3 \min a_i$.
It is also worth mentioning that this upper bound was further improved by several authors.
A: $|\exp(\dfrac{1}{n}\ln(a_1)+...+\dfrac{1}{n}\ln(a_n))-AM|\leq \max(a_i) /2\times |\dfrac{1}{n}\sum\limits_{i=1}^n (\ln(a_i))^2-(\dfrac{1}{n}\sum\limits_{i=1}^n \ln(a_i))^2|$
Because $\max(a_i)/2\times x^2-\exp(x)$ and $\max(a_i) /2\times x^2+\exp(x) $ are convexes on $[\min(\ln(a_i)), \max(\ln(a_i))] $
