  We extend the study of the square-free flow, recently introduced by Sarnak,
to the more general context of B-free integers, that is to say integers with no
factor in a given family B of pairwise relatively prime integers, the sum of
whose reciprocals is finite. Relying on dynamical arguments, we prove in
particular that the distribution of patterns in the characteristic function of
the B-free integers follows a shift-invariant probability measure, and gives
rise to a measurable dynamical system isomorphic to a specific minimal rotation
on a compact group. As a by-product, we get the abundance of twin B-free
integers. Moreover, we show that the distribution of patterns in small
intervals also conforms to the same measure. When elements of B are squares, we
introduce a generalization of the M\"obius function, and discuss a conjecture
of Chowla in this broader context.
