cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A073175 First occurrence of an n-digit prime as a substring in the concatenation of the natural numbers 12345678910111213141516171819202122232425262728293031....

This page as a plain text file.
%I A073175 #19 Feb 16 2025 08:32:46
%S A073175 2,23,101,4567,67891,789101,4567891,23456789,728293031,1234567891,
%T A073175 45678910111,678910111213,1222324252627,12345678910111,
%U A073175 415161718192021,3637383940414243,12223242526272829,910111213141516171
%N A073175 First occurrence of an n-digit prime as a substring in the concatenation of the natural numbers 12345678910111213141516171819202122232425262728293031....
%C A073175 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
%H A073175 Robert Israel, <a href="/A073175/b073175.txt">Table of n, a(n) for n = 1..999</a>
%H A073175 Eric W. Weisstein, <a href="https://mathworld.wolfram.com/ChampernowneConstant.html">Champernowne Constant.</a> [From _Jonathan Vos Post_, Aug 25 2008]
%H A073175 Eric W. Weisstein, <a href="https://mathworld.wolfram.com/Copeland-ErdosConstant.html">Copeland-Erdos Constant.</a> [From _Jonathan Vos Post_, Aug 25 2008]
%e A073175 Take 1234567891011121314151617....; a(4)=4567 because the first 4-digit prime in the sequence is 4567.
%e A073175 1213 is < 4567 but occurs later in the string.
%e A073175 a(5) = 67891 is the first occurrence of a five-digit substring that is a prime, 12345(67891)011121314...
%e A073175 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
%p A073175 N:= 1000: # to use the concatenation of 1 to N
%p A073175 L:= NULL:
%p A073175 for n from 1 to N do
%p A073175   L:= L, op(ListTools:-Reverse(convert(n,base,10)))
%p A073175 od:
%p A073175 L:= [L]:
%p A073175 nL:= nops(L);
%p A073175 f:= proc(n) local k,B,x;
%p A073175   for k from 1 to nL-n+1 do
%p A073175     B:= L[k..k+n-1];
%p A073175     x:= add(B[i]*10^(n-i),i=1..n);
%p A073175     if isprime(x) then return x fi
%p A073175   od;
%p A073175 false;
%p A073175 end proc:
%p A073175 seq(f(n),n=1..100); # _Robert Israel_, Aug 16 2018
%t A073175 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}]
%o A073175 (PARI) {s=Vec(Str(c=1)); for(d=1,30, for(j=1,9e9,
%o A073175 #s<d+j && s=concat( s,Vec( Str( c++ ))); s[j]=="0" && next;
%o A073175 isprime( p=eval( concat( vecextract( s,Str(j,"..",j+d-1) )))) || next;
%o A073175 print(d," ",p); next(2)))} /* replace "isprime" by 2==bigomega to get the semiprime analog */ \\ _M. F. Hasler_, Aug 23 2008
%Y A073175 Cf. A003617. - _M. F. Hasler_, Aug 23 2008
%Y A073175 Cf. A000040, A033307, A033308, A073062. - _Jonathan Vos Post_, Aug 25 2008
%K A073175 base,nonn
%O A073175 1,1
%A A073175 _Zak Seidov_, Aug 22 2002
%E A073175 Edited by _N. J. A. Sloane_, Aug 19 2008 at the suggestion of _R. J. Mathar_