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.

A101115 Beginning with the n-th prime, the number of successive times a new prime can be formed by prepending the smallest nonzero digit.

Original entry on oeis.org

0, 5, 0, 9, 5, 4, 8, 4, 5, 9, 4, 6, 2, 7, 6, 8, 9, 7, 6, 3, 14, 5, 5, 2, 4, 10, 1, 5, 7, 3, 4, 3, 5, 5, 0, 6, 5, 8, 5, 13, 4, 5, 4, 5, 3, 8, 4, 4, 5, 8, 3, 6, 1, 4, 4, 2, 5, 2, 2, 3, 4, 9, 8, 7, 4, 7, 3, 3, 5, 5, 7, 8, 4, 3, 3, 2, 1, 7, 0, 4, 3, 5, 3, 7, 9, 6, 6, 5, 6, 8
Offset: 1

Views

Author

Chuck Seggelin (seqfan(AT)plastereddragon.com), Dec 02 2004

Keywords

Comments

It is possible the procedure described would generate some left-truncatable primes (A024785). Although zero digits cannot be added, it is possible the starting prime may contain zeros. Therefore the possible number of digit additions is not limited by the length of the largest known left-truncatable prime. Further, because the smallest digit that satisfies the requirement is used each time, it is possible that choosing a larger digit would allow more single digits to be added. Therefore although some of the set of left-truncatable primes may be generated by this practice, not all of them will.
In principle it is possible that some a(n) is undefined because the process could go on indefinitely, but this is very unlikely. The largest a(n) for n <= 300000 is a(49120) = 18. - Robert Israel, Jun 29 2015

Examples

			a(2) is 5 because the second prime is 3, to which single nonzero digits can be prepended 5 times yielding a new prime each time (giving preference to the smallest digit that satisfies the requirement): 13, 113, 2113, 12113, 612113 (see A053583). There is no nonzero digit which can be prepended to 612113 to yield a new prime.
a(21) = 14 because the 21st prime (73) can be prepended with single nonzero digits 14 times yielding a new prime each time: 73, 173, 6173, 66173, ..., 4818372912366173.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p, nd, d, count, x, success;
          p:= ithprime(n); nd:= ilog10(p);
          for count from 0 do
            nd:= nd+1;
            success:= false;
            for d from 1 to 9 do
              x:= 10^nd * d + p;
              if isprime(x) then
                 success:= true;
                 break
              fi
            od;
            if not success then return(count) fi;
            p:= x;
          od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jun 29 2015
  • Python
    from sympy import isprime, prime
    def a(n):
        pn = prime(n)
        s, c, found = str(pn), 0, True
        while found:
            found = False
            for d in "123456789":
                if isprime(int(d+s)):
                    s, c, found = d+s, c+1, True
                    break
        return c
    print([a(n) for n in range(1, 91)]) # Michael S. Branicky, Jun 24 2022

A101116 Values in A101115 which are records.

Original entry on oeis.org

0, 5, 9, 14, 15, 18, 19, 20, 22
Offset: 1

Views

Author

Chuck Seggelin (seqfan(AT)plastereddragon.com), Dec 02 2004

Keywords

Comments

All primes up to 1000003 have been tested.

Crossrefs

Programs

  • Python
    from sympy import isprime, nextprime
    def agen(): # generator of tuple of terms of (A101116, A101117, A101118)
        n, pn, record = 0, 1, -1
        while True:
            n += 1
            pn = nextprime(pn)
            s, c, found = str(pn), 0, True
            while found:
                found = False
                for d in "123456789":
                    if isprime(int(d+s)):
                        s, c, found = d+s, c+1, True
                        break
            if c > record:
                record = c
                yield record, pn, int(s)
    g = agen()
    print([next(g)[0] for n in range(1, 7)]) # Michael S. Branicky, Jun 24 2022

Extensions

a(7)-a(8) from Michael S. Branicky, Jun 24 2022
a(9) from Michael S. Branicky, Jul 26 2024

A101117 a(n) = the first prime yielding the record value A101116(n).

Original entry on oeis.org

2, 3, 7, 73, 13799, 600307, 77197951, 4866134641, 36052921903
Offset: 1

Views

Author

Chuck Seggelin (seqfan(AT)plastereddragon.com), Dec 02 2004

Keywords

Examples

			a(6) = 600307 because 600307 is the first prime to which A101116(6) digits (18) can be prepended yielding a new prime each time (giving preference to the smallest digit which meets the requirement) - 600307, 3600307, 93600307, ..., 9912733515196363393600307.
		

Crossrefs

Programs

  • Python
    g = agen() # uses agen() and imports from A101116
    print([next(g)[1] for n in range(1, 7)]) # Michael S. Branicky, Jun 24 2022

Extensions

a(7)-a(8) from Michael S. Branicky, Jun 24 2022
a(9) from Michael S. Branicky, Jul 26 2024

A259848 Suffixes of 4818372912366173 (all primes).

Original entry on oeis.org

3, 73, 173, 6173, 66173, 366173, 2366173, 12366173, 912366173, 2912366173, 72912366173, 372912366173, 8372912366173, 18372912366173, 818372912366173, 4818372912366173
Offset: 1

Views

Author

Keywords

Examples

			.......................3
.......................73
.......................173
.......................6173
.......................66173
.......................366173
.......................2366173
.......................12366173
.......................912366173
.......................2912366173
.......................72912366173
.......................372912366173
.......................8372912366173
.......................18372912366173
.......................818372912366173
.......................4818372912366173
		

Crossrefs

Formula

a(n) = 4818372912366173 mod 10^n.
Showing 1-4 of 4 results.