Slow variation of counting functions Let $A \subseteq \mathbb{N} = \{1, 2, 3, \dots\}$ and define its counting function $\mathbb{R} \to \mathbb{R}$ to be $$A(x) = \#\{a \in A : a \leqslant x\}.$$
If $A \ne \varnothing$ then is it true that $$\liminf_{x \to \infty} \frac{A(\lambda x)}{A(x)} > 0$$ for all $\lambda \in (0, 1)$?

I've been thinking about this problem for several days, and although it seems too good to be true, I can't find a counterexample. It seems to be related to Karamata's notion of slowly varying functions, hence the title. Any insight would be appreciated.
Some examples:

*

*$A$ finite: $A(x) \sim \#A$ so the limit is always 1.

*$A = \{a, a+q, a+2q, \dots\}$: $A(x) = \lfloor \frac{x - a}{q} \rfloor \sim \frac{x}{q}$ so the limit is $\lambda$.

*$A = \{n^k : n \geqslant 1\}$: $A(x) = \lfloor \sqrt[k]{x} \rfloor \sim x^{1/k}$ so the limit is $\lambda^{1/k}$.

*$A = \{p : p \text{ is prime}\}$: $A(x) = \pi(x) \sim \frac{x}{\log x}$ (by the prime number theorem) so the limit is $\lambda$.

*$A = \{2,\ 4, 5,\ 8, 9, 10, 11,\ 16, \dots, 23,\ 32, \dots\}$ (first "half" of every dyadic block). Here, $\frac{x}{2} - 1 \leqslant A(x) \leqslant \frac{2x-1}{3}$ for large $x$, so $$\frac{A(\lambda x)}{A(x)} \geqslant \frac{\frac{\lambda x}{2} - 1}{\frac{2x-1}{3}} \to \frac{3\lambda}{4}$$ so the $\liminf$ is positive.

*$A = \{n : n \text{ has a 9}\}$: I actually have no idea, but it would be interesting to know the answer.

 A: I will prove what I said earlier in a comment, with a slight correction:
$$A = \{n:2m!<n<2m+1!, m \in \mathbb{N}\} $$is a counter example to the proposed conjecture. To see this, consider the sequence $x_n = \lfloor {\frac {2n!}{\lambda}}\rfloor$.
For this sequence, $A(\lambda x_n)~ 2n-2!(2n-2)$, because most of the elements of $A$ less than $\lambda x_n~2n!$ are the elements between $2n-2!$ and $2n-1!$.
We also find that $A(x_n)~(1-\lambda) x_n= \frac {2n!}{\lambda}-2n!$, because eventually $2n>>\frac {1}{\lambda}$, so all numbers between $2n!$ and $\frac {2n!}{\lambda}$ will be less than $2n+1!$, and thus be elements of A.
Putting these two formulas together, we get
$$\frac {A(\lambda x_n)}{A(x_n)}  ~\text {~} ~ \frac {2n-2!(2n-2)}{\frac {2n!}{\lambda}-2n!}= \frac {\lambda}{1-\lambda}\frac {2n-2}{(2n-1)(2n)}$$
which tends to $0$, thus the limit infinum is $0$.
A: Robo's idea is nice, but I'd like to flesh out some details and give a general construction that highlights the key points.
Let $a_n$ be an integer sequence growing so rapidly that $$\sum_{k < n} a_k = o(a_n) \tag{1}$$
as $n \to \infty$, e.g. $a_n = n!$ as per this post by robjohn.
Note, for later, that any function satisfying (1) will also satisfy $$a_{n-1} = o(a_n). \tag{2}$$
Let $$A = \bigcup_m \big(a_{2m}, a_{2m+1}\big] \cap \mathbb{N} \\ \phantom{AAAAAAAAAAAA} = \{n : a_{2m} < n \leqslant a_{2m+1} \text{ for some integer $m$}\},$$
a slight modification of Robo's definition, motivated by convenience; the number of integers in the interval $(a, b]$ is precisely the length $b-a$ (assuming $a, b \in \mathbb{Z}$).
Graphically, the function $A(x)$ is intermittently flat over increasingly long stretches.
Let $\lambda \in (0, 1)$ and define $x_n = a_{2n}/\lambda$.
Then $$A(\lambda x_n) = A(a_{2n}) = \big(a_{2n-1}-a_{2n-2}\big) + \big(a_{2n-3}-a_{2n-4}\big) + \dots$$
because $a_{2n} \not \in A$ (but just barely). Changing all the signs to $+$ appealing to (1), we have
$$A(\lambda x_n) \leqslant a_{2n-1} + \sum_{k<2n-1} a_k = a_{2n-1}\big(1 + o(1)\big)$$
so $$A(\lambda x_n) \ll a_{2n-1}. \tag{3}$$
On the other hand, $A$ contains all the integers in the interval $\big(\lambda x_n, \lfloor x_n \rfloor\big]$ if $n$ is large enough, because $x_n = a_{2n}/\lambda$ is dominated by $a_{2n+1}$ as $n \to \infty$ by (2).
Thus $$A(x_n) \ge \lfloor x_n \rfloor - \lambda x_n = (1 - \lambda) x_n + O(1) = \Big(\tfrac{1}{\lambda} - 1\Big) a_{2n} + O(1)$$
so $$A(x_n) \gg a_{2n}. \tag{4}$$
Putting (3) and (4) together and appealing to (2) once more, we deduce
$$\frac{A(\lambda x_n)}{A(x_n)} \ll \frac{a_{2n-1}}{a_{2n}} \to 0.$$
