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-4 of 4 results.

A127889 Smallest n-digit right-truncatable prime.

Original entry on oeis.org

2, 23, 233, 2333, 23333, 233993, 2339933, 23399339
Offset: 1

Views

Author

Ray Chandler, Feb 04 2007

Keywords

Comments

Agrees with A088603 for 8 terms, but this sequence ends there while A088603 continues.
Right-truncatable means that the integer part of successive divisions by 10 always yields primes (or zero). - M. F. Hasler, Nov 07 2018

Crossrefs

Programs

  • PARI
    A127889=vector(8, n, p=concat(apply(t->primes([t, t+1]*10), if(n>1, p))); p[1]) \\ M. F. Hasler, Nov 07 2018

A088604 a(n) = smallest prime in which n substrings containing the least significant digit are primes.

Original entry on oeis.org

2, 13, 113, 1223, 12113, 121283, 1237547, 12184967, 124536947, 1219861613, 12181833347, 121339693967, 1213536676883, 12673876537547, 121848768729173, 1275463876537547, 12429121339693967, 165678739293946997
Offset: 1

Views

Author

Amarnath Murthy, Oct 15 2003

Keywords

Comments

a(n) need not contain a(n-1) as a substring.
We exclude substrings that begin with 0, so a(3) is not 103. - David Wasserman, Aug 12 2005
Agrees with A127891 for 24 terms, but A127891 ends there while this sequence continues. - Ray Chandler, Mar 13 2007

Examples

			a(4) = 1223 in which the four substrings containing the LSD (3,23,223,1223) are primes.
		

Crossrefs

Programs

  • PARI
    f(n, d, digs, spare) = local(p, r, found); if (!d, return(n)); found = 0; for (i = 0, 9, p = n + i*10^digs; if ((i && isprime(p)) || spare, r = f(p, d - 1, digs + 1, spare - 1 + (i && isprime(p)))); if (r && (r < found || !found), found = r)); found;
    a(n) = local(i, r); i = 0; while (1, r = f(0, n + i, 0, i); if (r, return(r), i++)); \\ David Wasserman, Aug 12 2005

Extensions

More terms from David Wasserman, Aug 12 2005

A100893 a(n) = smallest n-digit prime formed by appending a digit to a(n-1); a(1) = 2.

Original entry on oeis.org

2, 23, 233, 2333, 23333
Offset: 1

Views

Author

Jorge Coveiro, Jan 10 2005

Keywords

Comments

This sequence is finite because there is no prime a(6) since 233331,233333,233337,233339 are not prime.
This is an initial subsequence of A048549, A065122, A088603, and A127889; and for any b, the base b analog of this sequence is an initial subsequence of the base b analog of each of these three sequences. [From Franklin T. Adams-Watters, Jun 27 2009]

Examples

			a(1)=2
a(2)=23
a(3)=233
a(4)=2333
a(5)=23333
		

A158191 Attach the smallest prime to the end of the string a(n-1) so a(n) is also prime.

Original entry on oeis.org

2, 23, 233, 2333, 23333, 2333323, 23333237, 233332373, 23333237353, 2333323735319, 2333323735319149, 2333323735319149571, 23333237353191495713, 23333237353191495713131, 233332373531914957131313
Offset: 1

Views

Author

Sergio Pimentel, Mar 13 2009

Keywords

Comments

a(279) has 1001 digits. - Michael S. Branicky, May 26 2023

Examples

			a(6) = 2333323 since a(5) = 23333 (prime) and 233333, 233335, 233337, 2333311, 2333313, 2333317 and 2333319 are all composite.
		

Crossrefs

Programs

  • Mathematica
    nxt[n_]:=Module[{k=3},While[CompositeQ[n*10^IntegerLength[k]+k],k = NextPrime[ k]];n*10^IntegerLength[k]+k]; NestList[nxt,2,20] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jul 13 2019 *)
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p, s = 2, "2"
        while True:
            yield p
            q = 2
            while not isprime(p:=int(s+str(q))):
                q = nextprime(q)
            s += str(q)
    print(list(islice(agen(), 15))) # Michael S. Branicky, May 26 2023

Extensions

More terms from Sean A. Irvine, Nov 29 2009
Showing 1-4 of 4 results.