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.

A088639 Smallest prime beginning with at least n n's (in decimal notation).

Original entry on oeis.org

2, 11, 223, 3331, 44449, 555557, 66666629, 777777701, 888888883, 99999999907, 1010101010101010101039, 11111111111111111111111, 12121212121212121212121223, 1313131313131313131313131301, 141414141414141414141414141497, 15151515151515151515151515151501
Offset: 0

Views

Author

Amarnath Murthy, Oct 27 2003

Keywords

Crossrefs

Cf. A088640. See A068120 for another version. See also A065584 - A065592.

Programs

  • Maple
    a:= proc(n) local d, h, s;
          s:= parse(cat(0, n$n));
          for d from 0 do
            for h to 10^d-1 do
              if isprime(s+h) then return s+h fi
            od:
            s:= s*10;
          od
        end:
    seq(a(n), n=0..16);  # Alois P. Heinz, Feb 11 2021
  • PARI
    A088639(n)={ local(p=10^#Str(n),d=1); n*=(p^n-1)/(p-1); until( (d*=10)*(n+1)>p=nextprime(n*d), );p} /* M. F. Hasler, Jan 13 2009 */
    
  • Python
    from sympy import isprime
    def a(n):
      if n == 0: return 2
      nns, i, pow10 = int(str(n)*n), 1, 1
      while True:
        i = 1
        while i < pow10:
          t = nns * pow10 + i
          if isprime(t): return t
          i += 2
        pow10 *= 10
    print([a(n) for n in range(16)]) # Michael S. Branicky, Feb 11 2021

Extensions

More terms from Ray Chandler, Nov 01 2003
More cross-references and initial term added by M. F. Hasler, Jan 13 2009

A068008 Least number needed to be appended to n n's to make a prime that does not contain more than n n's in a row.

Original entry on oeis.org

2, 3, 3, 1, 9, 7, 29, 39, 3, 43, 39, 1, 23, 27, 97, 53, 91, 37, 251, 93, 93, 19, 97, 61, 293, 153, 163, 1, 297, 103, 323, 61, 127, 113, 31, 127, 353, 67, 841, 187, 9, 21, 179, 429, 127, 97, 3, 319, 11, 51, 39, 191, 33, 3, 41, 151, 39, 47, 169, 787, 401, 57, 441, 571
Offset: 0

Views

Author

Robert G. Wilson v, Feb 22 2002

Keywords

Comments

This is not quite the "tail" of the numbers in A068120 because of the restriction that a(n) cannot begin with a zero. For example, a(25) = 153; 25252525252525252525252525252525252525252525252525153 is a prime, but it is greater than A068120(25) = 25252525252525252525252525252525252525252525252525061. - Dan Dima, Jan 29 2007

Examples

			a(0) = 2 because appending 2 to a zero-length string (i.e., 0 0's) yields 2, which is prime.
a(1) = 3 because appending a 3 to 1 yields 13, which is prime; a(1) is not 1, because appending a 1 to 1 yields 11, which (although prime) contains more than one 1 in a row.
a(2) = 3 because appending a 3 to 22 yields 223 (prime), whereas appending a 1 produces the nonprime 221=13*17.
		

Crossrefs

Cf. A068120.

Extensions

Examples edited, and definition edited to match the rationale for a(1)=3 (not 1), by Jon E. Schoenfield, Sep 21 2013
Showing 1-2 of 2 results.