TITLE: Find the least of the $\lambda$ such this inequality hold?
QUESTION [6 upvotes]: Give postive integer  $n$,  find the least real numbers $\lambda$, and $0<a_{i}<2^i,\forall i=1,2,\cdots,n$. have
  $$\sum_{i=1}^{n}\sum_{j=1}^{n}\{a_{i}a_{j}\}\le \lambda  \sum_{i=1}^{n}\{a_{i}\}$$ where $\{x\}=x-[x]$.

This inequality I have try sometimes,and I can't solve it. and I  have heard my country's There are  no people who solved this problem
Now it is said the answer is
$$\lambda_{\min}=2^{n+1}-n-2+\dfrac{n+(2^{n+1}-n-2)(2^n-1)}{\sqrt{(2^n-1)^2+1}}$$

REPLY [3 votes]: Update : Full Answer
Let $a_n = \sqrt{(2^n-1)^2+1}$ , $a_i = \frac{(2^i-1)(2^n-1)+1}{a_n}$ for all $1 \leq i <n$.
Then $\sum \limits_{i=1}^n \{a_i \} = \sum \limits_{i=1}^{n-1} \{\frac{(2^i-1)(2^n-1)+1}{a_n}\}  + \{a_n\} = \sum \limits_{i=1}^{n-1} \frac{(2^i-1)(2^n-1)+1}{a_n}-(2^i-1) + a_{n}-2^n+1 =\frac{\left(a_n-2^n+2\right) \left(a_n-2^n+n\right)}{a_n} $,
On the other-hand we have that $\sum \limits_{i=1}^{n} \sum \limits_{j=1}^{n} \{a_i a_j\} = \sum \limits_{i=1}^{n} \{a_i^2\} +2 \sum \limits_{i=1}^{n-2} \sum \limits_{j=i+1}^{n-1} \{a_i a_j\} + 2 \sum \limits_{i=1}^{n-1} \{a_i a_n\}$,
We know that $\lim \limits_{n \to \infty} \{a_i a_n\} =1$,since $a_i = \frac{integer}{a_n}$,so $2 \sum \limits_{i=1}^{n-1} \{a_i a_n\}=2(n-1)$.
Also $\lim \limits_{n \to \infty} \{ a_n^2 \} =1$ so we have $2n-1 + \sum \limits_{i=1}^{n-1} \{a_i^2\} +2 \sum \limits_{i=1}^{n-2} \sum \limits_{j=i+1}^{n-1} \{a_i a_j\} $
$\sum \limits_{i=1}^{n-1} \{a_i^2\} = \sum \limits_{i=1}^{n-1} \frac{((2^i-1)(2^n-1)+1)^2}{a_n^2} - \sum \limits_{i=1}^{n-1} (2^i-1)^2 = \frac{\left(2^n-2\right) \left(-6 n+8^n-3\ 2^{2 n+1}+3\ 2^n (n+4)-4\right)-a_n^2
   \left(3 n+4^n-3\ 2^{n+1}+5\right)}{3 a_n^2}$, and
$ 2 \sum \limits_{i=1}^{n-2} \sum \limits_{j=i+1}^{n-1} \{a_i a_j\} = 2 \sum \limits_{i=1}^{n-2} \sum \limits_{j=i+1}^{n-1} \frac{((2^i-1)(2^n-1)+1)((2^j-1)(2^n-1)+1)}{a_n^2} -(2^i-1)(2^j-1) = \frac{\left(2^n-2\right) \left(2 \left(-3\ 2^{n+1}+8^n+2\right)-3
   \left(2^n-2\right) \left(-n+2^{n+1}+1\right) n\right)-a_n^2 \left(2
   \left(4^n-1\right)+3 n \left(n-2^{n+1}+1\right)\right)}{3 a_n^2}$
so $\lambda \geq \frac{\left(2^n-2\right)^2 \left(2^n-n\right)^2-a^2 \left(n^2+4^n-2^{n+1} (n+1)+2\right)}{a \left(a-2^n+2\right) \left(a-2^n+n\right)}$ , so $\lambda \geq 4*2^n-2n-4$ (i proved it, not easy to prove but anyone could check and see this is true for all integers,see Alex's result about this lower bound), and this becomes more and more accurate as $n \to \infty$.
Now we will prove the upper bound, 
we have one of the 2 cases :
1) there is $i$ such that $\{ a_i \} \geq \frac{1}{n^2}$ or 2) for all $i$ we have $\{a_i \} < \frac{1}{n^2}$
in the first case we know that $ \sum \limits_{i=1}^{n} \{ a_i \} \geq \frac{1}{n^2}$ and that $ \sum \limits_{i=1}^{n} \sum \limits_{j=1}^{n} \{a_i a_j\} \leq n^2$ so $\lambda \leq \frac{n^2}{\frac{1}{n^2}} = n^4$.
in the second case we get that $\sum \limits_{i=1}^{n} \sum \limits_{j=1}^{n} \{a_i a_j \} = \{ (\{a_i \} +[a_i]) (\{a_j\}+[a_j]) \} = \{ [a_i][a_j] + [a_j]\{a_i\} + [a_i] \{a_j\} + \{a_i \} \{a_j \} \}  \leq \{ (2^j-1)\{a_i\}+ (2^i-1) \{a_j\} +\{a_i \} \{a_j \} \} = 2 \sum \limits_{i=1}^{n} \sum \limits_{j=1}^{n} (2^j-1) + \sum \limits_{i=1}^{n} \sum \limits_{j=1}^{n} \{a_i \} \{a_j \} = (4*2^n-2n-4) \sum \limits_{i=1}^{n} \{a_i \} + \sum \limits_{i=1}^{n} \sum \limits_{j=1}^{n} \{a_i \} \{a_j \} \leq  (4*2^n-2n-4) \sum \limits_{i=1}^{n} \{a_i \}+ \sum \limits_{i=1}^{n} \{a_i\} \sum \limits_{j=1}^{n} \frac{1}{n^2} = (4*2^n-2n-4+\frac{1}{n}) \sum \limits_{i=1}^{n} \{a_i \}$
So $(4*2^n-2n-4+\frac{1}{n}) \sum \limits_{i=1}^{n} \{a_i \} \geq \lambda \sum \limits_{i=1}^{n} \{a_i \} $ so $(4*2^n-2n-4+\frac{1}{n}) \geq \lambda $
So we are left with $ 4*2^n-2n-4 \leq \lambda \leq max(n^4,4*2^n-2n-4+\frac{1}{n})$
And its true that $4*2^n-2n-4+\frac{1}{n} > n^4 $ for all $n>12$,
So for all integers $n >12$ we have that $4*2^n-2n-4 \leq \lambda \leq 4*2^n-2n-4+\frac{1}{n}$, (for smaller cases one could prove that its also holds true but not easy).
Thus completing the proof and $4*2^n-2n-4 \leq \lambda \leq 4*2^n-2n-4+\frac{1}{n} $ or $\lambda = 4*2^n-2n-4+O(\frac{1}{n})$.
Update by Alex Ravsky. Your idea is good. I came to a similar idea yesterday,  but I had no Internet connection first and had to go to my university later. I am still trying to improve it. Your idea can be developed as follows. Put $S=\sum_{i=1}^{n}\{a_i\}$. If $S\le \lambda –2^{n+2}+2n+4$ then my upper bound works. If  $S\ge \lambda –2^{n+2}+2n+4$ then it suffices to have $\lambda (\lambda –2^{n+2}+2n+4)\ge n^2$, that is we can put $$\lambda=2^{n+1}-n-2+\sqrt{(2^{n+1}-n-2)^2+n^2}\le 2^{n+2}-2n-4+\frac{n^2}{2^{n+1}-2n-4}.$$
On the other hand, $$\lambda_{\min}-2^{n+2}+2n+4=
\frac{n+(2^{n+1}-n-2)(2^n-1)}{\sqrt{(2^n-1)^2+1}}-2^{n+1}-n-2=$$
$$\frac{n}{\sqrt{(2^n-1)^2+1}}+\varepsilon_n,$$ where
$$|\varepsilon_n|=
 (2^{n+1}-n-2) \left|\frac{2^n-1}{\sqrt{(2^n-1)^2+1}}-1\right|\le $$
$$\frac{2^{n+1}}{2^n-1}\left|2^n-1-\sqrt{(2^n-1)^2+1}\right|=$$
$$\frac{2^{n+1}}{2^n-1}\left|\frac{(2^n-1)^2-(\sqrt{(2^n-1)^2+1})^2}{2^n-1+\sqrt{(2^n-1)^2+1}}\right|\le $$
$$\frac{2^{n+1}}{2^n-1}\left|\frac{1}{2^{n+1}-2}\right|=O\left(\frac 1{2^n}\right).$$
Similarly, for my lower bound the difference is 
$n(\sqrt{(2^n-1)^2+1}-(2^n-1))= n\frac{
\left(\sqrt{(2^n-1)^2+1}\right)^2-(2^n-1)^2}{\sqrt{(2^n-1)^2+1}+2^n-1}=
\frac{n}{\sqrt{(2^n-1)^2+1}+2^n-1}\le \frac{n}{2^{n+1}-2}.$
The following graph represents the current bounds state, where values of $f(n)$ for each funtion $f$ is drawn as $(f(n)-2^{n+2}+2n+4)\frac {2^n}n$. Legend: red - $\lambda_{min}$, green – current best upper bound, blue - my lower bound.