For any A ⊆ N, let U (A, N ) be the number of its elements not exceeding N . Suppose that A + A has V (A, N ) elements not exceeding N , where the elements in the sumset A + A are counted with multiplicities. We first prove a sharp inequality between the size of U (A, N ) and that of V (A, N ) which, for the upper limits ω(A) = lim sup N →∞ U (A, N )N −1/2 and σ(A) = lim sup N →∞ V (A, N )N −1 , implies ω(A) 2 ≥ 4σ(A)/π. Then, as an application, we show that, for any square-free integer d > 1 and any ε > 0, there are infinitely many positive integers N such that at least ( 8/π−ε) √ N digits among the first N digits of the binary expansion of √ d are equal to 1.