A set  $R\subset \mathbb{N}$ is called rational if it is well approximable by finite unions of arithmetic progressions, meaning that for every
$R\subset \mathbb{N}$ is called rational if it is well approximable by finite unions of arithmetic progressions, meaning that for every  $\unicode[STIX]{x1D716}>0$ there exists a set
$\unicode[STIX]{x1D716}>0$ there exists a set  $B=\bigcup _{i=1}^{r}a_{i}\mathbb{N}+b_{i}$, where
$B=\bigcup _{i=1}^{r}a_{i}\mathbb{N}+b_{i}$, where  $a_{1},\ldots ,a_{r},b_{1},\ldots ,b_{r}\in \mathbb{N}$, such that
$a_{1},\ldots ,a_{r},b_{1},\ldots ,b_{r}\in \mathbb{N}$, such that  $$\begin{eqnarray}\overline{d}(R\triangle B):=\limsup _{N\rightarrow \infty }\frac{|(R\triangle B)\cap \{1,\ldots ,N\}|}{N}<\unicode[STIX]{x1D716}.\end{eqnarray}$$
$$\begin{eqnarray}\overline{d}(R\triangle B):=\limsup _{N\rightarrow \infty }\frac{|(R\triangle B)\cap \{1,\ldots ,N\}|}{N}<\unicode[STIX]{x1D716}.\end{eqnarray}$$ $\unicode[STIX]{x1D6F7}_{x}:=\{n\in \mathbb{N}:\boldsymbol{\unicode[STIX]{x1D711}}(n)/n<x\}$, where
$\unicode[STIX]{x1D6F7}_{x}:=\{n\in \mathbb{N}:\boldsymbol{\unicode[STIX]{x1D711}}(n)/n<x\}$, where  $x\in [0,1]$ and
$x\in [0,1]$ and  $\boldsymbol{\unicode[STIX]{x1D711}}$ is Euler’s totient function. We investigate the combinatorial and dynamical properties of rational sets and obtain new results in ergodic Ramsey theory. Among other things, we show that if
$\boldsymbol{\unicode[STIX]{x1D711}}$ is Euler’s totient function. We investigate the combinatorial and dynamical properties of rational sets and obtain new results in ergodic Ramsey theory. Among other things, we show that if  $R\subset \mathbb{N}$ is a rational set with
$R\subset \mathbb{N}$ is a rational set with  $\overline{d}(R)>0$, then the following are equivalent:
$\overline{d}(R)>0$, then the following are equivalent:
(a)  $R$ is divisible, i.e.
$R$ is divisible, i.e.  $\overline{d}(R\cap u\mathbb{N})>0$ for all
$\overline{d}(R\cap u\mathbb{N})>0$ for all  $u\in \mathbb{N}$;
$u\in \mathbb{N}$;
(b)  $R$ is an averaging set of polynomial single recurrence;
$R$ is an averaging set of polynomial single recurrence;
(c)  $R$ is an averaging set of polynomial multiple recurrence.
$R$ is an averaging set of polynomial multiple recurrence.
As an application, we show that if  $R\subset \mathbb{N}$ is rational and divisible, then for any set
$R\subset \mathbb{N}$ is rational and divisible, then for any set  $E\subset \mathbb{N}$ with
$E\subset \mathbb{N}$ with  $\overline{d}(E)>0$ and any polynomials
$\overline{d}(E)>0$ and any polynomials  $p_{i}\in \mathbb{Q}[t]$,
$p_{i}\in \mathbb{Q}[t]$,  $i=1,\ldots ,\ell$, which satisfy
$i=1,\ldots ,\ell$, which satisfy  $p_{i}(\mathbb{Z})\subset \mathbb{Z}$ and
$p_{i}(\mathbb{Z})\subset \mathbb{Z}$ and  $p_{i}(0)=0$ for all
$p_{i}(0)=0$ for all  $i\in \{1,\ldots ,\ell \}$, there exists
$i\in \{1,\ldots ,\ell \}$, there exists  $\unicode[STIX]{x1D6FD}>0$ such that the set
$\unicode[STIX]{x1D6FD}>0$ such that the set  $$\begin{eqnarray}\{n\in R:\overline{d}(E\cap (E-p_{1}(n))\cap \cdots \cap (E-p_{\ell }(n)))>\unicode[STIX]{x1D6FD}\}\end{eqnarray}$$
$$\begin{eqnarray}\{n\in R:\overline{d}(E\cap (E-p_{1}(n))\cap \cdots \cap (E-p_{\ell }(n)))>\unicode[STIX]{x1D6FD}\}\end{eqnarray}$$
Ramsey-theoretical applications naturally lead to problems in symbolic dynamics, which involve rationally almost periodic sequences (sequences whose level-sets are rational). We prove that if  ${\mathcal{A}}$ is a finite alphabet,
${\mathcal{A}}$ is a finite alphabet,  $\unicode[STIX]{x1D702}\in {\mathcal{A}}^{\mathbb{N}}$ is rationally almost periodic,
$\unicode[STIX]{x1D702}\in {\mathcal{A}}^{\mathbb{N}}$ is rationally almost periodic,  $S$ denotes the left-shift on
$S$ denotes the left-shift on  ${\mathcal{A}}^{\mathbb{Z}}$ and
${\mathcal{A}}^{\mathbb{Z}}$ and  $$\begin{eqnarray}X:=\{y\in {\mathcal{A}}^{\mathbb{Z}}:\text{each word appearing in}~y~\text{appears in}~\unicode[STIX]{x1D702}\},\end{eqnarray}$$
$$\begin{eqnarray}X:=\{y\in {\mathcal{A}}^{\mathbb{Z}}:\text{each word appearing in}~y~\text{appears in}~\unicode[STIX]{x1D702}\},\end{eqnarray}$$ $\unicode[STIX]{x1D702}$ is a generic point for an
$\unicode[STIX]{x1D702}$ is a generic point for an  $S$-invariant probability measure
$S$-invariant probability measure  $\unicode[STIX]{x1D708}$ on
$\unicode[STIX]{x1D708}$ on  $X$ such that the measure-preserving system
$X$ such that the measure-preserving system  $(X,\unicode[STIX]{x1D708},S)$ is ergodic and has rational discrete spectrum.
$(X,\unicode[STIX]{x1D708},S)$ is ergodic and has rational discrete spectrum.