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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

2, 23, 101, 4567, 67891, 789101, 4567891, 23456789, 728293031, 1234567891, 45678910111, 678910111213, 1222324252627, 12345678910111, 415161718192021, 3637383940414243, 12223242526272829, 910111213141516171
Offset: 1

Views

Author

Zak Seidov, Aug 22 2002

Keywords

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

Examples

			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
		

Crossrefs

Cf. A003617. - M. F. Hasler, Aug 23 2008

Programs

  • 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}]
  • PARI
    {s=Vec(Str(c=1)); for(d=1,30, for(j=1,9e9,
    #sM. F. Hasler, Aug 23 2008

Extensions

Edited by N. J. A. Sloane, Aug 19 2008 at the suggestion of R. J. Mathar

A073176 First n-digit prime in the concatenation of odd integers allowing leading zeros.

Original entry on oeis.org

3, 13, 911, 5791, 79111, 31051, 1232527, 23252729, 113151719, 2527293133, 57911131517, 991011031051, 6769717375777, 13579111315171, 135791113151719, 4547495153555759, 31517192123252729, 719212325272931333, 1131517192123252729, 71921232527293133353
Offset: 1

Views

Author

Zak Seidov, Aug 22 2002

Keywords

Comments

Leading zeros count but are not printed (cf. A073428).

Examples

			a(4) = 5791 because first 4-digit prime in 135791113151719212325272931333537394143454749... is 5791. Notice that a(6) = 31051 because actually it is 031051, If we remove initial zeros, then a(6) = 105107.
		

Crossrefs

Programs

  • Maple
    S:= "":
    for i from 1 to 300 by 2 do
      S:= cat(S,sprintf("%d",i))
    od:
    nS:= length(S):
    for n from 1 do
      found:= false;
      for i from 1 to nS-n+1 do
        x:= parse(S[i..n+i-1]);
        if isprime(x) then R[n]:= x; found:= true; break fi
      od;
      if not found then break fi;
    od:
    seq(R[i],i=1..n-1); # Robert Israel, Nov 27 2024

Extensions

Data corrected by Sean A. Irvine, Nov 20 2024
Name modified by Sean A. Irvine, Jan 31 2025
Showing 1-2 of 2 results.