Squarefree-part bound for smooth numbers (source code)

= Squarefree-part bound for smooth numbers

Let $S$ be a <finite set> of <prime numbers> and let $f_S(x)$ count <S-smooth numbers> $1\leq n\leq x$, where $x\geq1$. Each such $n$ has a unique expression $n=ab^2$, where $a$ is a positive <squarefree integer> and $b$ is a <positive integer>. Split every <prime exponent> into its <parity> and an even remainder to obtain this decomposition.

Every <prime factor> of $a$ belongs to $S$, so $a$ is the <product> of a <subset> of $S$, giving at most $2^{|S|}$ possibilities. Also $b\leq\sqrt{x/a}\leq\sqrt x$. Ignoring further restrictions on $b$ only increases the count, proving
$$
f_S(x)\leq2^{|S|}\lfloor\sqrt x\rfloor\leq2^{|S|}\sqrt x.
$$
In particular, each fixed finite-prime family has <natural density> zero. This differs from allowing the smoothness bound, and hence the prime set, to grow with $x$.