Prove/Disprove that there exist positive integers $a$ and $N$ such that the sequence $\overline{N}, \overline{aN}, \overline{aaN}, \overline{aaaN}, \ldots$ contains infinitely many primes.

($\overline{xy}$ refers to concatenating the digits of $x$ and $y$)

This problem was thrown around a maths chat. We ran some computer programs use Miller-Rabin primality test on Python and we got some sequences which seemed to keep having primes (such as $a=2$, $N=3$), and others which we could easily mod-bash to see only have finitely many primes (such as $a=5$, $N=37$).

We couldn't determine whether it would always be the case that there are finitely many primes, or whether $a=5$, $N=37$ was an exception.

EDIT: After a bit more thought, we started considering what sort of conditions would be sufficient for such a sequence to only contain finitely many primes.

There are some obvious ones like $N$ even or divisible by $5$, as well as $p \mid a, N$ for odd primes $p$. However, these don't cover the example of $a=5$, $N=37$.

Are there any more sufficient conditions?

  • $\begingroup$ There are odd values of $b$ such that $2^n+b$ is composite for all $n$. Such $b$ are usually found by using "covering congruences". A similar approach may work for this question. $\endgroup$ Commented Feb 4, 2018 at 8:09
  • 1
    $\begingroup$ Have you had a chance to follow up on this, Sharky? $\endgroup$ Commented Feb 5, 2018 at 22:58
  • $\begingroup$ No, not yet. I'll get a chance probably at the end of this week due to personal things. $\endgroup$ Commented Feb 6, 2018 at 3:14
  • $\begingroup$ the article on wikipedia about repunits en.wikipedia.org/wiki/Repunit seems related (to the edited part of the above question), e.g. there is only one base 8 repunit prime, 73. Also, primes.utm.edu/glossary/xpage/Repunit.html $\endgroup$
    – Mirko
    Commented Feb 22, 2018 at 1:17

1 Answer 1


Here's another formulation: Does $a\frac{10^{nd}-1}{10^d-1}+b,n\in \mathbb N$ contain infinitely many primes?

This looks a lot like Mersenne primes except base $10$ instead of $2$. Since no one knows if there are infinitely many Mersenne primes I'd expect this to be very hard to prove either way.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .