Solution (source code)

= Solution

Put $F(m)=m(m+2)(m+6)$ and let $\rho(d)$ be the number of roots of $F$ modulo $d$. For squarefree $d$, the <Chinese remainder theorem> gives
$$
\rho(d)=\prod_{p\mid d}\rho(p),
\qquad
\rho(2)=1,quad \rho(3)=2,quad \rho(p)=3\quad(p\geq5).
$$
Indeed, for $p\geq5$ the three roots $0,-2,-6$ are distinct. Counting $m\leq X$ in each of the $\rho(d)$ residue classes gives
$$
|\mathcal A_d|
=\#\{m\leq X:d\mid F(m)\}
=\frac{\rho(d)}dX+O(\rho(d)).
$$
Consequently a suitable <sieve distribution> is
$$
g(d)=\frac{\rho(d)}d,
\qquad
r_d=O(\rho(d))=O(3^{\omega(d)}).
$$
This is the <polynomial root density in a sieve> calculation.