Prime numbers of the form $(1\times11\times111\times1111\times...)-(1+11+111+1111+...)$

Let $$R(1) = 1-1,$$ $$R(2) = (1\times11) - (1+11),$$ $$R(3) = (1\times11\times111) - (1+11+111),$$ and so on...

$$R(4)=1355297\quad\text{(a prime number!)}$$

$R(4)$ is the only prime I found of such form up to $R(200)$. Are there anymore primes of such form?


Probabilistic answer: If $\phi_n\in {\Bbb N}$ is a sequence of 'random' integers going to infinity then the probability of $\phi_n$ being a prime is $\sim 1/\ln \phi_n$. When $\sum_{n\geq N} \frac{1}{\ln \phi_n}$ goes to zero fast with $N$ it is most 'likely' that there are no primes among these numbers for $N$ large. The words 'random' and 'likely' are obviously subject to interpretations.


If another prime of the form $R(n)$ exists, then $n$ must be at least $490$ and $R(n)$ must have more than $100,000$ digits.

For the following numbers $n\le 1000$, $R(n)$ has no "small" prime factor :

$$[52, 490, 532, 574, 592, 922, 928, 964]$$

$R(1000)$ has already $499,546$ digits.

It is unlikely that there is another prime $R(n)$ because the sequence grows very fast and the chance that a number with more than $10^5$ digits is prime, is very low. Of course, this is not a proof.

A proof that there is no other prime should be out of reach. The only chance seems to be : Finding another prime.


  1. Just a very basic observation, not a complete answer. Let's note by $$a_n=1111...1$$ with $n$ of $1's$. So we have $$a_n \equiv 1 \pmod{10}$$ And $$\prod_{k=1}^{n} a_k \equiv 1 \pmod{10}$$ And $$\sum_{k=1}^{n} a_k \equiv n \pmod{10}$$ And $$R(n)=\prod_{k=1}^{n} a_k - \sum_{k=1}^{n} a_k \equiv 1 - n \pmod{10}$$ So, whenever $n-1$ is divisible by $2,5$ or $10$, $R(n)$ is not a prime.

  2. And another one is $$a_n \equiv \sum_{k=1}^{n}1=n \pmod{9}$$ So $$\prod_{k=1}^{n} a_k \equiv n! \pmod{9}$$ And $$\sum_{k=1}^{n} a_k \equiv \frac{n(n+1)}{2} \pmod{9}$$ And $$R(n)=\prod_{k=1}^{n} a_k - \sum_{k=1}^{n} a_k \equiv n! - \frac{n(n+1)}{2} \pmod{9}$$ For $n \geq 6$ with $\frac{n(n+1)}{2}$ divisible by 3, $R(n)$ is not a prime. Out of $n=6t$, $n=6t+1$, $n=6t+2$, $n=6t+3$, $n=6t+4$ and $n=6t+5$ only $n=6t+1$ and $6t+4$ could yield primes. Because $n=6t+1$ is clarified by the case 1 ($n-1 = 6t$ divisible by $2$) we are left with $6t+4$.

  3. Another basic observation is $$\gcd(a_p,a_q)=1$$ where $p,q$- primes. A short proof is here.