1: \begin{abstract}
2: Sarnak has recently initiated the study of the Möbius function and its square, the characteristic function of square-free integers, from a dynamical point of view, introducing the Möbius flow and the square-free flow as the action of the shift map on the respective subshfits generated by these functions.
3:
4: In this paper, we extend the study of the square-free flow 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.
5: As a by-product, we get the abundance of twin $\B$-free numbers. Moreover, we show that the distribution of patterns in small intervals of the form $[N,N+\sqrt{N})$ also conforms to the same measure.
6:
7: When elements of $\B$ are squares, we introduce a generalization of the Möbius function, and discuss a conjecture of Chowla in this broader context.
8: \end{abstract}
9: