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

A068167 Define an increasing sequence as follows. Given the first term, called the seed (which need not share the property of the remaining terms), subsequent terms are obtained by inserting at least one digit in the previous term so as to obtain the smallest number with the specified property. This is the prime sequence with the seed a(1) = 2.

Original entry on oeis.org

2, 23, 223, 1223, 10223, 102023, 1020023, 10200263, 102002603, 1020026303, 10200226303, 102002263031, 1020002263031, 10200022363031, 102000223263031, 1020000223263031, 10200002232630131, 102000022326301313, 1020000222326301313, 10200002223236301313
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Examples

			The primes that can be obtained by inserting/placing a digit in a(2) = 23 are 223, 233, 239, 263, 283, 293, etc. a(3) = 223 is the smallest.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local s, w, m;
          if n=1 then 2
        else w:=a(n-1); s:=""||w; m:=length(s);
             min(select(x->length(x)=m+1 and isprime(x),
             {seq(seq(parse(cat(seq(s[h], h=1..i), j,
             seq(s[h], h=i+1..m))), j=0..9), i=0..m)})[])
          fi
        end:
    seq(a(n), n=1..23);  # Alois P. Heinz, Nov 07 2014

Extensions

Corrected and extended by Robert Gerbicz, Sep 06 2002

A068169 Define an increasing sequence as follows. Given the first term called the seed (the seed need not have the property of the sequence.). Subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 4.

Original entry on oeis.org

4, 41, 241, 2141, 21341, 213461, 2123461, 21123461, 211234561, 2112343561, 21123043561, 211230043561, 2112030043561, 21112030043561, 211120030043561, 2110120030043561, 21101020030043561, 211010200230043561, 2110102002300430561, 21010102002300430561
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Examples

			The primes obtained by inserting/placing a digit in a(2) = 41 are 241, 419, 421 etc... a(3)= 241 is the smallest.
		

Crossrefs

Extensions

Corrected and extended by Robert Gerbicz, Sep 06 2002

A068170 Define an increasing sequence as follows. Given the first term, called the seed (the seed need not have the property of the remaining terms of the sequence), subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 5.

Original entry on oeis.org

5, 53, 353, 3253, 30253, 130253, 1300253, 10300253, 100300253, 1003002053, 10030020503, 100300200503, 1003002050503, 10013002050503, 100130002050503, 1001300002050503, 10013000020503503, 100013000020503503, 1000130000205035083, 10001300002015035083
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Examples

			The primes obtained by inserting/placing a digit in a(2) = 53 are 353, 523, ...; a(3) = 353 is the smallest.
		

Crossrefs

Extensions

Corrected and extended by Robert Gerbicz, Sep 06 2002

A068171 Define an increasing sequence as follows: Given the first term called the seed (the seed need not have the property of the sequence.), subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 6.

Original entry on oeis.org

6, 61, 461, 3461, 33461, 332461, 3132461, 31320461, 313204061, 3130204061, 23130204061, 231302004061, 2131302004061, 21313020024061, 213130200240161, 2131230200240161, 12131230200240161, 121312302002401613, 1210312302002401613, 12103123020020401613, 121031230200203401613, 1210312300200203401613
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Examples

			The primes obtained by inserting/placing a digit in a(2) = 61 are 461, 619, 641, etc...a(3) = 461 is the smallest.
		

Crossrefs

Extensions

More terms from Robert Gerbicz, Sep 06 2002
Definition edited by Harvey P. Dale, Feb 28 2023

A068172 Define an increasing sequence as follows. Given the first term called the seed (the seed need not have the property of the sequence.). Subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 7.

Original entry on oeis.org

7, 17, 107, 1087, 10487, 104087, 1024087, 10024087, 100024087, 1000124087, 10001240087, 100012400837, 1000124008327, 10000124008327, 100001124008327, 1000011224008327, 10000110224008327, 100001100224008327, 1000010100224008327, 10000101002240083271, 100001010022400283271, 1000010100221400283271
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Examples

			The primes obtained by inserting/placing a digit in a(2) = 17 are 107,127, 137, etc...a(3) = 107 is the smallest.
		

Crossrefs

Extensions

More terms from Robert Gerbicz, Sep 06 2002

A068173 Define an increasing sequence as follows. Given the first term called the seed (the seed need not have the property of the sequence.). Subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 8.

Original entry on oeis.org

8, 83, 283, 1283, 12583, 112583, 1102583, 11002583, 110025803, 1010025803, 10100258303, 101002258303, 1010022508303, 10100225080303, 101002250803093, 1010022508030793, 10100225080303793, 101002250803030793, 1010022508030305793, 10100224508030305793
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Examples

			The primes obtained by inserting/placing a digit in a(2) = 89 are 389, 809, etc...a(3) = 389 is the smallest.
		

Crossrefs

Extensions

Corrected and extended by Robert Gerbicz, Sep 06 2002

A249447 Least n-digit prime whose digit sum is also prime.

Original entry on oeis.org

2, 11, 101, 1013, 10037, 100019, 1000033, 10000019, 100000037, 1000000033, 10000000019, 100000000019, 1000000000039, 10000000000037, 100000000000031, 1000000000000037, 10000000000000079, 100000000000000013, 1000000000000000031, 10000000000000000051, 100000000000000000039
Offset: 1

Views

Author

Paolo P. Lava, Oct 29 2014

Keywords

Comments

Subsequence of A046704 (primes with digits sum being prime).
Some terms of this sequence are also in A003617, the least n-digit primes. - Michel Marcus, Oct 30 2014

Examples

			a(1) = 2 because it is the least prime with just one digit.
a(2) = 11 because it is the least prime with 2 digits whose sum, 1 + 1 = 2, is a prime.
Again, a(7) = 1000033 because it is the least prime with 7 digits whose sum is a prime: 1 + 0 + 0 + 0 + 0 + 3 + 3 = 7.
		

Crossrefs

Programs

  • Maple
    P:=proc(q) local a,b,k,n; for k from 0 to q do
    for n from 10^k to 10^(k+1)-1 do if isprime(n) then a:=n; b:=0;
    while a>0 do b:=b+(a mod 10); a:=trunc(a/10); od;
    if isprime(b) then print(n); break; fi; fi;
    od; od; end: P(10^3);
  • PARI
    a(n) = {p = nextprime(10^(n-1)); while (!isprime(sumdigits(p)), p = nextprime(p+1)); p;} \\ Michel Marcus, Oct 29 2014

A068174 Define an increasing sequence as follows. Start with an initial term, the seed (which need not have the property of the sequence); subsequent terms are obtained by inserting/placing at least one digit in the previous term to obtain the smallest number with the given property. This is the prime sequence with the seed a(1) = 9.

Original entry on oeis.org

9, 19, 109, 1009, 10009, 100019, 1000159, 10001569, 100001569, 1000015069, 10000135069, 100001350649, 1000013500649, 10000130500649, 100001303500649, 1000013032500649, 10000103032500649, 100001030325003649, 1000010130325003649, 10000101303250036493
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Examples

			The primes obtained by inserting/placing a digit in a(2) = 19 are 109, 139, 149, 179, 199 etc. and a(3) = 109 is the smallest.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{b = PadLeft[ IntegerDigits[n], Floor[ Log[10, n] + 1]], k = 0}, While[ !PrimeQ[ FromDigits[ Insert[b, k, -2]]], k++ ]; FromDigits[ Insert[b, k, -2]]]; NestList[ f, 9, 18]

Extensions

Edited by N. J. A. Sloane and Robert G. Wilson v, May 08 2002
Corrected and extended by Robert Gerbicz, Sep 06 2002

A068168 Define an increasing sequence as follows. Given the first term called the seed (the seed need not have the property of the sequence.). Subsequent terms are defined as obtained by inserting/placing digits (at least one) in the previous term to obtain the smallest number with a given property. This is the growing prime sequence for the seed a(1) = 3.

Original entry on oeis.org

3, 13, 103, 1013, 10103, 100103, 1001003, 10010023, 100010023, 1000100239, 10001000239, 100010002039, 1000100020319, 10001000200319, 100001000200319, 1000010002000319, 10000100002000319, 100001000020003109, 1000010000200031039, 10000100002000310329
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Comments

a(5) onwards the sequence is A068166.

Examples

			The primes obtained by inserting/placing a digit in a(2) = 13 are 113,131,313 etc... a(3)= 113 is the smallest.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local s, w, m;
          if n=1 then 3
        else w:=a(n-1); s:=""||w; m:=length(s);
             min(select(x->length(x)=m+1 and isprime(x),
             {seq(seq(parse(cat(seq(s[h], h=1..i), j,
             seq(s[h], h=i+1..m))), j=0..9), i=0..m)})[])
          fi
        end:
    seq(a(n), n=1..23);  # Alois P. Heinz, Nov 07 2014

Extensions

Corrected and extended by Robert Gerbicz, Sep 06 2002

A356273 a(n) is the position of the least prime in the ordered set of numbers obtained by inserting/placing any digit anywhere in the digits of n (except a zero before 1st digit), or 0 if there is no prime in that set.

Original entry on oeis.org

2, 5, 1, 5, 8, 7, 1, 11, 1, 2, 1, 10, 1, 14, 7, 10, 1, 10, 1, 0, 4, 7, 4, 7, 8, 11, 1, 11, 4, 10, 1, 0, 2, 14, 11, 16, 1, 14, 1, 5, 2, 7, 8, 11, 16, 11, 3, 19, 1, 8, 1, 8, 3, 10, 17, 14, 1, 20, 3, 7, 4, 0, 1, 11, 14, 13, 1, 17, 2, 8, 2, 16, 1, 14, 13, 14, 2, 22, 1, 17
Offset: 1

Views

Author

Michel Marcus, Aug 01 2022

Keywords

Comments

It appears that a(n) = 0 for n in A124665.
891, a term of A124665 and with a(891) = 9, is the first counterexample. - Michael S. Branicky, Aug 01 2022

Examples

			For n=1, the resulting set is (10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91) where the least prime 11 is at position 2, so a(1) = 2.
For n=2, the resulting set is (12, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 42, 52, 62, 72, 82, 92) where the least prime 23 is at position 5, so a(2) = 5.
		

Crossrefs

Related to the process in A068166, A068167, A068169, A068170, A068171, A068172, A068173, and A068174.
Cf. A124665.

Programs

  • Mathematica
    Table[Function[w, If[IntegerQ[#], #, 0] &@ FirstPosition[Rest@ Union@ Flatten@ Table[FromDigits@ Insert[w, d, k], {k, Length[w] + 1, 1, -1}, {d, 0, 9}], ?PrimeQ][[1]]][IntegerDigits[n]], {n, 80}] (* _Michael De Vlieger, Aug 01 2022 *)
  • PARI
    get(d, rd, n, k) = {if (n==0, return(fromdigits(concat(d, k)))); if (n==#d, return(fromdigits(concat(k, d)))); my(v = concat(Vec(d, #d-n), k)); v = concat(v, Vecrev(Vec(rd, n))); fromdigits(v);}
    a(n) = {my(d=digits(n), rd = Vecrev(d), list = List(), p); for (n=0, #d, my(kstart = if (n==#d, 1, 0)); for (k=kstart, 9, listput(list, get(d, rd, n, k)););); my(svec = Set(Vec(list))); for (k=1, #svec, if (isprime(svec[k]), return(k)););}
    
  • Python
    from sympy import isprime
    def a(n):
        s = str(n)
        out = set(s[:i]+c+s[i:] for i in range(len(s)+1) for c in "0123456789")
        out = sorted(int(k) for k in out if k[0] != "0")
        ptest = (i for i, k in enumerate(sorted(out), 1) if isprime(int(k)))
        return next(ptest, 0)
    print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Aug 01 2022
Showing 1-10 of 10 results.