A052077 Smallest prime formed by concatenating n consecutive increasing numbers, or 0 if no such prime exists.
2, 23, 0, 4567, 1516171819, 0, 78910111213, 23456789, 0, 45678910111213, 129130131132133134135136137138139, 0, 567891011121314151617, 5051525354555657585960616263, 0, 128129130131132133134135136137138139140141142143
Offset: 1
Links
- Paolo P. Lava, Table of n, a(n) for n = 1..43
- C. Rivera, Prime Puzzle 78.
Programs
-
Mathematica
f[n_] := If[Mod[n, 3] == 0, 0, Block[{k = 1}, While[d = FromDigits@ Flatten@ IntegerDigits[ Range[k, k + n - 1]]; !PrimeQ@ d, k++]; d]]; Array[f, 16] (* Robert G. Wilson v, Jun 29 2012 *)
Extensions
Terms a(7)-a(15) are calculated by Carlos Rivera and Felice Russo
a(16) from Max Alekseyev, Jan 31 2010
Comments