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.

Previous Showing 21-30 of 43 results. Next

A096245 Number of n-digit base-12 deletable primes.

Original entry on oeis.org

5, 25, 186, 1398, 11500, 99074, 893062, 8352961, 80564801
Offset: 1

Views

Author

Michael Kleber, Feb 28 2003

Keywords

Comments

A prime p is a base-b deletable prime if, when written in base b, it has the property that removing some digit leaves either the empty string or another deletable prime. "Digit" means digit in base b.
Deleting a digit cannot leave any leading 0's in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.

Crossrefs

Programs

  • Mathematica
    b = 12; a = {5}; d = {2, 3, 5, 7, 11};
    For[n = 2, n <= 5, n++,
      p = Select[Range[b^(n - 1), b^n - 1], PrimeQ[#] &];
      ct = 0;
      For[i = 1, i <= Length[p], i++,
       c = IntegerDigits[p[[i]], b];
       For[j = 1, j <= n, j++,
        t = Delete[c, j];
        If[t[[1]] == 0, Continue[]];
        If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; ct++;
         Break[]]]];
      AppendTo[a, ct]];
    a (* Robert Price, Nov 13 2018 *)
  • Python
    from sympy import isprime
    from sympy.ntheory.digits import digits
    def strmap(d):
        return str(d) if d < 10 else "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[d-10]
    def ok(n, prevset, base=12): # works for bases 2-36
        if not isprime(n): return False
        s = "".join(strmap(d) for d in digits(n, base)[1:])
        si = (s[:i]+s[i+1:] for i in range(len(s)))
        return any(t[0] != '0' and int(t, base) in prevset for t in si)
    def afind(terms, base=12): # works for bases 3-36
        s = set([p for p in range(1, base) if isprime(p)])
        alst, snxt = [len(s)], set()
        print(len(s), end=", ")
        for n in range(2, terms+1):
            for i in range(base**(n-1), base**n):
                if ok(i, s):
                    snxt.add(i)
            s, snxt = snxt, set()
            print(len(s), end=", ")
    afind(6) # Michael S. Branicky, Jan 17 2022

Extensions

a(6)-a(8) from Ryan Propper, Jul 19 2005
Edited by Charles R Greathouse IV, Aug 03 2010
a(9) from Michael S. Branicky, Jan 17 2022

A125589 Smallest n-digit base-10 deletable prime.

Original entry on oeis.org

2, 13, 103, 1013, 10039, 100103, 1000193, 10000931, 100001903, 1000003957, 10000003957, 100000013957, 1000000030957, 10000000301957, 100000000730957, 1000000000730957, 10000000003632979, 100000000007309357
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2007

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime. "Digit" means digit in base b.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.

Crossrefs

Programs

  • Mathematica
    b = 10; a = {2}; d = {2, 3, 5, 7};
    For[n = 2, n <= 6, n++,
      found = False;
      p = Select[Range[b^(n - 1), b^n - 1], PrimeQ[#] &];
      For[i = 1, i <= Length[p], i++,
       c = IntegerDigits[p[[i]], b];
       For[j = 1, j <= n, j++,
        t = Delete[c, j];
        If[t[[1]] == 0, Continue[]];
        If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]];
         If[! found , AppendTo[a, p[[i]]]]; found = True; Break[]]];
    ]]; a (* Robert Price, Nov 13 2018 *)

Extensions

a(6) - a(8) from Michael Kleber, Jan 08 2007
a(9) - a(14) from Phil Carmody, Jan 09 2007
a(15) - a(18) from Joshua Zucker, Jan 09 2007

A125590 Largest n-digit base-10 deletable prime.

Original entry on oeis.org

7, 97, 997, 9973, 99929, 999907, 9999907, 99999307, 999996671, 9999996073, 99999966307, 999999908773, 9999999710639, 99999999697769, 999999997160639, 9999999996977699, 99999999980803477, 999999999961861807, 9999999999961861807, 99999999999807429133
Offset: 1

Views

Author

N. J. A. Sloane, Jan 07 2007

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime. "Digit" means digit in base b.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.

Examples

			99929 -> 9929 -> 929 -> 29 -> 2.
		

References

  • C. Caldwell, Truncatable primes, J. Recreational Math., 19:1 (1987) 30-33. [Discusses left truncatable primes, right truncatable primes and deletable primes.]

Crossrefs

Programs

  • Mathematica
    b = 10; a = {7}; d = {2, 3, 5, 7};
    For[n = 2, n <= 5, n++,
      p = Select[Range[b^(n - 1), b^n - 1], PrimeQ[#] &];
      For[i = 1, i <= Length[p], i++,
       c = IntegerDigits[p[[i]], b];
       For[j = 1, j <= n, j++,
        t = Delete[c, j];
        If[t[[1]] == 0, Continue[]];
        If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; Break[]]]];
      AppendTo[a, Last[d]]];
    a (* Robert Price, Nov 13 2018 *)
  • Python
    from sympy import isprime, prevprime
    from functools import cache
    @cache
    def deletable_prime(n):
        if not isprime(n): return False
        if n < 10: return True
        s = str(n)
        si = (s[:i]+s[i+1:] for i in range(len(s)))
        return any(t[0] != '0' and deletable_prime(int(t)) for t in si)
    def a(n):
        p = prevprime(10**n)
        while not deletable_prime(p): p = prevprime(p)
        return p
    print([a(n) for n in range(1, 15)]) # Michael S. Branicky, Jan 13 2022

Extensions

a(6)-a(8) from Michael Kleber, Jan 08 2007
a(9)-a(16) from Joshua Zucker, May 11 2007
a(17)-a(20) from Michael S. Branicky, Jan 13 2022

A320587 Primes that are not Base-3 deletable primes (written in base 10).

Original entry on oeis.org

3, 13, 31, 37, 41, 43, 67, 79, 97, 103, 109, 113, 127, 131, 139, 149, 151, 157, 163, 193, 199, 211, 227, 229, 239, 241, 257, 271, 277, 281, 283, 293, 307, 311, 313, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 433, 439, 443
Offset: 1

Views

Author

Robert Price, Nov 14 2018

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.
Complement of all primes and A319596.

Crossrefs

Programs

  • Mathematica
    b = 3; d = {};
    p = Select[Range[2, 10000], PrimeQ[#] &];
    For[i = 1, i <= Length[p], i++,
      c = IntegerDigits[p[[i]], b];
      If[Length[c] == 1, AppendTo[d, p[[i]]]; Continue[]];
      For[j = 1, j <= Length[c], j++,
       t = Delete[c, j];
       If[t[[1]] == 0, Continue[]];
    If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; Break[]]]]; Complement[Table[Prime[n], {n, PrimePi[Last[d]]}], d] (* Robert Price, Dec 06 2018 *)

Extensions

Added the term 3. As pointed out by Kevin Ryde, there is no need to "seed" the list using base-2 assumptions. - Robert Price, Dec 06 2018

A321596 Primes that are not base-2 deletable primes (written in base 10).

Original entry on oeis.org

17, 31, 41, 67, 71, 89, 97, 103, 113, 127, 131, 139, 181, 191, 193, 199, 223, 227, 233, 239, 241, 251, 257, 263, 269, 271, 283, 337, 353, 367, 373, 379, 383, 401, 409, 431, 433, 439, 443, 449, 463, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 571, 577
Offset: 1

Views

Author

Robert Price, Nov 14 2018

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime. However, in base 2 we adopt the convention that 2 = 10 and 3 = 11 are deletable.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.
Complement of all primes and A096246.

Crossrefs

Programs

  • Mathematica
    d = {2, 3};
    For[n = 3, n <= 15, n++,
      p = Select[Range[2^(n - 1), 2^n - 1], PrimeQ[#] &];
      For[i = 1, i <= Length[p], i++,
       c = IntegerDigits[p[[i]], 2];
       For[j = 1, j <= n, j++,
        t = Delete[c, j];
        If[t[[1]] == 0, Continue[]];
        If[MemberQ[d, FromDigits[t, 2]], AppendTo[d, p[[i]]];  Break[]]]]]; Complement[Table[Prime[n], {n, PrimePi[Last[d]]}], d]

A321658 Primes that are not base-4 deletable primes (written in base 10).

Original entry on oeis.org

5, 17, 37, 41, 73, 89, 97, 101, 131, 137, 149, 193, 199, 233, 257, 277, 281, 293, 313, 337, 347, 349, 353, 367, 373, 379, 389, 401, 409, 421, 521, 569, 577, 593, 601, 613, 617, 641, 661, 673, 677, 683, 761, 769, 809, 811, 823, 829, 853, 857, 859, 929, 937
Offset: 1

Views

Author

Robert Price, Nov 15 2018

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.
Complement of all primes and A319596.

Crossrefs

Programs

  • Mathematica
    b = 4; d = {};
    p = Select[Range[2, 10000], PrimeQ[#] &];
    For[i = 1, i <= Length[p], i++,
      c = IntegerDigits[p[[i]], b];
      If[Length[c] == 1, AppendTo[d, p[[i]]]; Continue[]];
      For[j = 1, j <= Length[c], j++,
       t = Delete[c, j];
       If[t[[1]] == 0, Continue[]];
    If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; Break[]]]]; Complement[Table[Prime[n], {n, PrimePi[Last[d]]}], d] (* Robert Price, Dec 06 2018 *)

A321701 Primes that are not base-5 deletable primes (written in base 10).

Original entry on oeis.org

5, 29, 31, 41, 43, 83, 101, 109, 127, 131, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 199, 211, 223, 229, 233, 241, 251, 257, 277, 281, 283, 293, 313, 331, 349, 383, 401, 409, 419, 421, 431, 433, 443, 457, 461, 463, 467, 491, 499, 509, 521, 541, 577, 587, 593, 599
Offset: 1

Views

Author

Robert Price, Nov 17 2018

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.
Complement of all primes and A321700.

Crossrefs

Programs

  • Mathematica
    b = 5; d = {};
    p = Select[Range[2, 10000], PrimeQ[#] &];
    For[i = 1, i <= Length[p], i++,
      c = IntegerDigits[p[[i]], b];
      If[Length[c] == 1, AppendTo[d, p[[i]]]; Continue[]];
      For[j = 1, j <= Length[c], j++,
       t = Delete[c, j];
       If[t[[1]] == 0, Continue[]];
    If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; Break[]]]]; Complement[Table[Prime[n], {n, PrimePi[Last[d]]}], d] (* Robert Price, Dec 06 2018 *)

A322172 Primes that are not base-7 deletable primes (written in base 10).

Original entry on oeis.org

7, 11, 13, 29, 43, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 107, 109, 113, 127, 151, 157, 173, 179, 181, 193, 197, 211, 229, 239, 257, 269, 271, 277, 281, 283, 307, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499
Offset: 1

Views

Author

Robert Price, Nov 29 2018

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.
Complement of all primes and A321910.

Crossrefs

Programs

  • Mathematica
    b = 7; d = {};
    p = Select[Range[2, 10000], PrimeQ[#] &];
    For[i = 1, i <= Length[p], i++,
      c = IntegerDigits[p[[i]], b];
      If[Length[c] == 1, AppendTo[d, p[[i]]]; Continue[]];
      For[j = 1, j <= Length[c], j++,
       t = Delete[c, j];
       If[t[[1]] == 0, Continue[]];
    If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; Break[]]]]; Complement[Table[Prime[n], {n, PrimePi[Last[d]]}], d] (* Robert Price, Dec 06 2018 *)

A322174 Primes that are not base-6 deletable primes (written in base 10).

Original entry on oeis.org

7, 37, 43, 61, 151, 223, 229, 241, 271, 277, 307, 331, 337, 349, 367, 523, 691, 709, 733, 863, 907, 1009, 1033, 1051, 1069, 1103, 1109, 1123, 1223, 1231, 1249, 1283, 1289, 1297, 1301, 1303, 1321, 1327, 1381, 1423, 1429, 1447, 1471, 1483, 1531, 1549, 1567, 1597, 1621, 1627, 1657, 1663, 1741
Offset: 1

Views

Author

Robert Price, Nov 29 2018

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.
Complement of all primes and A322173.

Crossrefs

Programs

  • Mathematica
    b = 6; d = {};
    p = Select[Range[2, 10000], PrimeQ[#] &];
    For[i = 1, i <= Length[p], i++,
      c = IntegerDigits[p[[i]], b];
      If[Length[c] == 1, AppendTo[d, p[[i]]]; Continue[]];
      For[j = 1, j <= Length[c], j++,
       t = Delete[c, j];
       If[t[[1]] == 0, Continue[]];
    If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; Break[]]]]; Complement[Table[Prime[n], {n, PrimePi[Last[d]]}], d] (* Robert Price, Dec 06 2018 *)

A322444 Primes that are not base-8 deletable primes (written in base 10).

Original entry on oeis.org

71, 73, 79, 97, 103, 113, 127, 149, 173, 193, 227, 241, 257, 263, 271, 281, 283, 307, 311, 313, 409, 419, 433, 439, 449, 457, 463, 487, 503, 521, 569, 577, 587, 593, 599, 607, 617, 631, 641, 647, 653, 661, 673, 701, 727, 733, 739, 743, 757, 769, 823, 827, 839, 881, 887, 907, 911, 919, 929
Offset: 1

Views

Author

Robert Price, Dec 08 2018

Keywords

Comments

A prime p is a base-b deletable prime if when written in base b it has the property that removing some digit leaves either the empty string or another deletable prime.
Deleting a digit cannot leave any leading zeros in the new string. For example, deleting the 2 in 2003 to obtain 003 is not allowed.
Complement of all primes and A322443 .

Crossrefs

Programs

  • Mathematica
    b = 8; d = {};
    p = Select[Range[2, 10000], PrimeQ[#] &];
    For[i = 1, i <= Length[p], i++,
    c = IntegerDigits[p[[i]], b];
    If[Length[c] == 1, AppendTo[d, p[[i]]]; Continue[]];
    For[j = 1, j <= Length[c], j++,
    t = Delete[c, j];
    If[t[[1]] == 0, Continue[]];
    If[MemberQ[d, FromDigits[t, b]], AppendTo[d, p[[i]]]; Break[]]]]; Complement[Table[Prime[n], {n, PrimePi[Last[d]]}], d] (* Robert Price, Dec 08 2018 *)
Previous Showing 21-30 of 43 results. Next