# Primality of the number of obtained by concatenating the n consecutive digits

Let $f_n$ be the number obtained by concatenating the first $n$ numbers (in base 10). For example

$f_1 = 1, f_3 = 123$ and $f_{13} = 12345678910111213.$

Now if $n$ is even or divisible by $5$ then so is $f_n$ and if $n(n+1) \equiv 0 \pmod{3}$ then $f_n$ is divisible by $3.$ My question is

Is $f_n$ always composite?

Verifying the question with a computer I get that it holds for $n$ up to $1000$ but I don't see how to prove it.

It does not seem to be case that $f_n$ always has small prime divisors as for example $f_7 = 127 \cdot 9721.$

Hence I don't see any simple approach to this question.

-
I don't think there is a good way. Concatenation of consecutive digits doesn't have a good simple mathematical description (try expressing it in symbols, instead of describing it with language) Note that you are left with the cases where $n \equiv 1 \pmod{6}$, and $f_7, f_{13}$ are not easily factorized. –  Calvin Lin Apr 10 '14 at 14:42
@CalvinLin $\lfloor 10^n C_{10}\rfloor$, where C is Champernowne's constant... –  draks ... Apr 10 '14 at 15:26
Heuristically, there should be a prime somewhere. $f_n \lt 2\cdot 10^n$, so using the fact that a "random" number $m$ has $\frac 1{\log m}$ chance of being prime, we can find the "expected" number of primes as being greater than $\sum \frac 1{\log (2\cdot 10^n)}$, which diverges. Even doing $\sum \frac 1{\log (2\cdot 10^{6n+1})}$ to take care of the even and divisible by $3$ cases it diverges. That doesn't help you find one, however. –  Ross Millikan Apr 10 '14 at 15:34
I've completed testing to 53,000 without finding a prime, but as Charles says, we expect them eventually. –  DanaJ Apr 17 '14 at 14:31
@DanaJ: You may consider submitting your calculations to the OEIS @ oeis.org/A007908 -- either now or when you hit the next 'natural' boundary. –  Charles Apr 17 '14 at 17:49

This concatenation is A007908 in the OEIS, where you can see that Charles Nicol and John Selfridge ask the same question in

R. K. Guy, Unsolved Problems in Number Theory, A3.

There are no primes in the first 5000 terms of the sequence, but heuristics suggest that there are infinitely many. In particular, there 'should' be about

$$\frac{\log\log n-\log\log m}{2}$$

primes between $m$ and $n$. This suggests that there should be about one prime with index between 5000 and

$$\exp(\exp(\log(\log 5000)+2))\approx2\cdot10^{27}$$

Edit: I have just checked the first 20,000 terms without finding a prime. This expands the previous interval to $6\cdot10^{31}$.

-