OFFSET
1,1
COMMENTS
This is to Champernowne's constant 0.12345678910111213... (Sloane's A033307) as A073062 is to A033308 Decimal expansion of Copeland-Erdos constant: concatenate primes. - Jonathan Vos Post, Aug 25 2008
LINKS
Robert Israel, Table of n, a(n) for n = 1..999
Eric W. Weisstein, Champernowne Constant. [From Jonathan Vos Post, Aug 25 2008]
Eric W. Weisstein, Copeland-Erdos Constant. [From Jonathan Vos Post, Aug 25 2008]
EXAMPLE
Take 1234567891011121314151617....; a(4)=4567 because the first 4-digit prime in the sequence is 4567.
1213 is < 4567 but occurs later in the string.
a(5) = 67891 is the first occurrence of a five-digit substring that is a prime, 12345(67891)011121314...
a(1) = 2 = prime(1). a(2) = 23 = prime(9). a(3) = 571 = prime(105). a(4) = 2357 = prime(350). a(5) = 11131 = prime(1349). - Jonathan Vos Post, Aug 25 2008
MAPLE
N:= 1000: # to use the concatenation of 1 to N
L:= NULL:
for n from 1 to N do
L:= L, op(ListTools:-Reverse(convert(n, base, 10)))
od:
L:= [L]:
nL:= nops(L);
f:= proc(n) local k, B, x;
for k from 1 to nL-n+1 do
B:= L[k..k+n-1];
x:= add(B[i]*10^(n-i), i=1..n);
if isprime(x) then return x fi
od;
false;
end proc:
seq(f(n), n=1..100); # Robert Israel, Aug 16 2018
MATHEMATICA
p200=Flatten[IntegerDigits[Range[200]]]; Do[pn=Partition[p200, n, 1]; ln=Length[pn]; tab=Table[Sum[10^(n-k)*pn[[i, k]], {k, n}], {i, ln}]; Print[{n, Select[tab, PrimeQ][[1]]}], {n, 20}]
PROG
(PARI) {s=Vec(Str(c=1)); for(d=1, 30, for(j=1, 9e9,
#s<d+j && s=concat( s, Vec( Str( c++ ))); s[j]=="0" && next;
isprime( p=eval( concat( vecextract( s, Str(j, "..", j+d-1) )))) || next;
print(d, " ", p); next(2)))} /* replace "isprime" by 2==bigomega to get the semiprime analog */ \\ M. F. Hasler, Aug 23 2008
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Zak Seidov, Aug 22 2002
EXTENSIONS
Edited by N. J. A. Sloane, Aug 19 2008 at the suggestion of R. J. Mathar
STATUS
approved