1, 11, 111, 1111111111, are all repunits, but 111110 for example is not.
A reunit with
\[n\]
1's is called the nth rep unit and labelled \[R_n\]
, so that for example, \[R_6=111111\]
.We can write repunits in terms of other repunits.
\[R_6=111111=111 \times 1000+111=1000R_3+R_3=1001R_3\]
.In general repunits have the properties
\[R_n=\frac{10^n-1}{9}\]
\[R_{m+n}=R_m \times 10^n+R_n\]
.\[R_{mn}=R_n \times 10^{(m-1)n}+R_n \times 10^{(m-2)n}+...+R_n \times 10^n+R_n\]
.Repunits are rarely prime. Repunits
\[R_{2k}\]
are divisible by 11, so \[n\]
has to be odd and greater than 2 for \[R_n\]
to be prime, but this is not sufficient e.g. \[R_3=111=37 \times 3\]
is composite \[R_2, \; R_{19}, \; R_{23}\]
are prime